diff options
author | Miguel Jacq <mig@mig5.net> | 2019-03-11 15:55:17 +1100 |
---|---|---|
committer | Miguel Jacq <mig@mig5.net> | 2019-03-11 15:55:17 +1100 |
commit | 365798b12f1e887d75b20266f0b636c756969427 (patch) | |
tree | 041c9856b4baecdc3e46f3e3caacbb6536052ef4 /onionshare_gui | |
parent | 040e7e4ca9c383248457496a9071dba16134e138 (diff) | |
download | onionshare-365798b12f1e887d75b20266f0b636c756969427.tar.gz onionshare-365798b12f1e887d75b20266f0b636c756969427.zip |
Various Startup Timer fixes for strings, bundled mode, stealth mode, startup/shutdown time clashes
Diffstat (limited to 'onionshare_gui')
-rw-r--r-- | onionshare_gui/mode/__init__.py | 1 | ||||
-rw-r--r-- | onionshare_gui/server_status.py | 17 | ||||
-rw-r--r-- | onionshare_gui/settings_dialog.py | 2 | ||||
-rw-r--r-- | onionshare_gui/threads.py | 2 |
4 files changed, 14 insertions, 8 deletions
diff --git a/onionshare_gui/mode/__init__.py b/onionshare_gui/mode/__init__.py index d4f0cd09..a9478e42 100644 --- a/onionshare_gui/mode/__init__.py +++ b/onionshare_gui/mode/__init__.py @@ -275,6 +275,7 @@ class Mode(QtWidgets.QWidget): self.common.log('Mode', 'cancel_server: quitting startup thread') self.startup_thread.canceled = True self.app.onion.scheduled_key = None + self.app.onion.scheduled_auth_cookie = None self.startup_thread.quit() if self.onion_thread: self.common.log('Mode', 'cancel_server: quitting onion thread') diff --git a/onionshare_gui/server_status.py b/onionshare_gui/server_status.py index 3ee10f14..3000491e 100644 --- a/onionshare_gui/server_status.py +++ b/onionshare_gui/server_status.py @@ -205,6 +205,11 @@ class ServerStatus(QtWidgets.QWidget): self.url.show() self.copy_url_button.show() + if self.app.stealth: + self.copy_hidservauth_button.show() + else: + self.copy_hidservauth_button.hide() + def update(self): """ Update the GUI elements based on the current state. @@ -244,11 +249,6 @@ class ServerStatus(QtWidgets.QWidget): if self.common.settings.get('shutdown_timeout'): self.shutdown_timeout_container.hide() - - if self.app.stealth: - self.copy_hidservauth_button.show() - else: - self.copy_hidservauth_button.hide() else: self.url_description.hide() self.url.hide() @@ -292,7 +292,8 @@ class ServerStatus(QtWidgets.QWidget): self.server_button.setStyleSheet(self.common.css['server_status_button_working']) self.server_button.setEnabled(True) if self.scheduled_start: - self.server_button.setText(strings._('gui_waiting_to_start').format(self.scheduled_start)) + scheduled_friendly_time = self.startup_timer.dateTime().toString("MMM dd, H:mmAP") + self.server_button.setText(strings._('gui_waiting_to_start').format(scheduled_friendly_time)) self.startup_timer_container.hide() else: self.server_button.setText(strings._('gui_please_wait')) @@ -332,6 +333,10 @@ class ServerStatus(QtWidgets.QWidget): if QtCore.QDateTime.currentDateTime().toPyDateTime() > self.timeout: can_start = False Alert(self.common, strings._('gui_server_timeout_expired'), QtWidgets.QMessageBox.Warning) + if self.common.settings.get('startup_timer'): + if self.timeout <= self.scheduled_start: + Alert(self.common, strings._('gui_timeout_cant_be_earlier_than_startup'), QtWidgets.QMessageBox.Warning) + can_start = False if can_start: self.start_server() elif self.status == self.STATUS_STARTED: diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index f29915a7..58fb2244 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -75,7 +75,7 @@ class SettingsDialog(QtWidgets.QDialog): self.startup_timer_checkbox = QtWidgets.QCheckBox() self.startup_timer_checkbox.setCheckState(QtCore.Qt.Checked) self.startup_timer_checkbox.setText(strings._("gui_settings_startup_timer_checkbox")) - startup_timer_label = QtWidgets.QLabel(strings._("gui_settings_whats_this").format("https://github.com/micahflee/onionshare/wiki/Using-the-Auto-Stop-Timer")) + startup_timer_label = QtWidgets.QLabel(strings._("gui_settings_whats_this").format("https://github.com/micahflee/onionshare/wiki/Using-the-Startup-Timer")) startup_timer_label.setStyleSheet(self.common.css['settings_whats_this']) startup_timer_label.setTextInteractionFlags(QtCore.Qt.TextBrowserInteraction) startup_timer_label.setOpenExternalLinks(True) diff --git a/onionshare_gui/threads.py b/onionshare_gui/threads.py index dda8094e..cb7447b5 100644 --- a/onionshare_gui/threads.py +++ b/onionshare_gui/threads.py @@ -57,7 +57,7 @@ class OnionThread(QtCore.QThread): time.sleep(0.2) self.success_early.emit() # Unregister the onion so we can use it in the next OnionThread - self.mode.app.onion.cleanup() + self.mode.app.onion.cleanup(False) else: self.mode.app.start_onion_service(await_publication=True) # wait for modules in thread to load, preventing a thread-related cx_Freeze crash |