mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-11 04:02:40 -03:00
Fixes for displaying autostart timer countdown
This commit is contained in:
parent
539be2ded3
commit
2ebc22c5af
1 changed files with 8 additions and 2 deletions
|
@ -117,9 +117,15 @@ class Mode(QtWidgets.QWidget):
|
||||||
if self.server_status.status == ServerStatus.STATUS_WORKING:
|
if self.server_status.status == ServerStatus.STATUS_WORKING:
|
||||||
if self.server_status.scheduled_start:
|
if self.server_status.scheduled_start:
|
||||||
now = QtCore.QDateTime.currentDateTime()
|
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
|
# 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 the auto-shutdown timer has stopped, stop the server
|
||||||
if self.server_status.status == ServerStatus.STATUS_STARTED:
|
if self.server_status.status == ServerStatus.STATUS_STARTED:
|
||||||
|
|
Loading…
Reference in a new issue