mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-29 01:06:16 -05:00
Fixes for displaying autostart timer countdown
This commit is contained in:
parent
539be2ded3
commit
2ebc22c5af
@ -117,9 +117,15 @@ class Mode(QtWidgets.QWidget):
|
||||
if self.server_status.status == ServerStatus.STATUS_WORKING:
|
||||
if self.server_status.scheduled_start:
|
||||
now = QtCore.QDateTime.currentDateTime()
|
||||
seconds_remaining = now.secsTo(self.server_status.startup_timer.dateTime())
|
||||
if self.server_status.local_only:
|
||||
seconds_remaining = now.secsTo(self.server_status.startup_timer.dateTime())
|
||||
else:
|
||||
seconds_remaining = now.secsTo(self.server_status.scheduled_start.replace(second=0, microsecond=0))
|
||||
# Update the server button
|
||||
self.server_status.server_button.setText(strings._('gui_waiting_to_start').format(self.human_friendly_time(seconds_remaining)))
|
||||
if seconds_remaining > 0:
|
||||
self.server_status.server_button.setText(strings._('gui_waiting_to_start').format(self.human_friendly_time(seconds_remaining)))
|
||||
else:
|
||||
self.server_status.server_button.setText(strings._('gui_please_wait'))
|
||||
|
||||
# If the auto-shutdown timer has stopped, stop the server
|
||||
if self.server_status.status == ServerStatus.STATUS_STARTED:
|
||||
|
Loading…
Reference in New Issue
Block a user