summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiguel Jacq <mig@mig5.net>2019-03-24 18:16:12 +1100
committerMiguel Jacq <mig@mig5.net>2019-03-24 18:16:12 +1100
commit2ebc22c5afd55a604f67239ff07d2f0a44ec23e1 (patch)
tree52f92899fd151f9c7807712ad353afdacc67fcfa
parent539be2ded367107019ea39a7bc269d9c8fb4786f (diff)
downloadonionshare-2ebc22c5afd55a604f67239ff07d2f0a44ec23e1.tar.gz
onionshare-2ebc22c5afd55a604f67239ff07d2f0a44ec23e1.zip
Fixes for displaying autostart timer countdown
-rw-r--r--onionshare_gui/mode/__init__.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/onionshare_gui/mode/__init__.py b/onionshare_gui/mode/__init__.py
index 5437ccef..f1184f2d 100644
--- a/onionshare_gui/mode/__init__.py
+++ b/onionshare_gui/mode/__init__.py
@@ -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: