diff options
author | Micah Lee <micah@micahflee.com> | 2019-05-06 18:06:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-06 18:06:14 -0700 |
commit | bbf6c02da645fcd4fc50db18dd341178ad4fa2e6 (patch) | |
tree | c1e2757c56f517e051c9f905f8a7a12e1b8d66ae /onionshare_gui/onionshare_gui.py | |
parent | a8201593ec0bfe7596ef530e80aa30e5172ef71d (diff) | |
parent | 9e9c29b189cb91ea495a85ed749730395926e07b (diff) | |
download | onionshare-bbf6c02da645fcd4fc50db18dd341178ad4fa2e6.tar.gz onionshare-bbf6c02da645fcd4fc50db18dd341178ad4fa2e6.zip |
Merge pull request #980 from micahflee/developv2.1
Version 2.1
Diffstat (limited to 'onionshare_gui/onionshare_gui.py')
-rw-r--r-- | onionshare_gui/onionshare_gui.py | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/onionshare_gui/onionshare_gui.py b/onionshare_gui/onionshare_gui.py index 27abf5e5..17839669 100644 --- a/onionshare_gui/onionshare_gui.py +++ b/onionshare_gui/onionshare_gui.py @@ -62,13 +62,17 @@ class OnionShareGui(QtWidgets.QMainWindow): self.config = config if self.config: self.common.load_settings(self.config) + else: + self.common.load_settings() + + strings.load_strings(self.common) # System tray menu = QtWidgets.QMenu() self.settings_action = menu.addAction(strings._('gui_settings_window_title')) self.settings_action.triggered.connect(self.open_settings) - help_action = menu.addAction(strings._('gui_settings_button_help')) - help_action.triggered.connect(SettingsDialog.help_clicked) + self.help_action = menu.addAction(strings._('gui_settings_button_help')) + self.help_action.triggered.connect(lambda: SettingsDialog.help_clicked(self)) exit_action = menu.addAction(strings._('systray_menu_exit')) exit_action.triggered.connect(self.close) @@ -228,7 +232,10 @@ class OnionShareGui(QtWidgets.QMainWindow): self.server_status_label.setText(strings._('gui_status_indicator_share_stopped')) elif self.share_mode.server_status.status == ServerStatus.STATUS_WORKING: self.server_status_image_label.setPixmap(QtGui.QPixmap.fromImage(self.server_status_image_working)) - self.server_status_label.setText(strings._('gui_status_indicator_share_working')) + if self.share_mode.server_status.autostart_timer_datetime: + self.server_status_label.setText(strings._('gui_status_indicator_share_scheduled')) + else: + self.server_status_label.setText(strings._('gui_status_indicator_share_working')) elif self.share_mode.server_status.status == ServerStatus.STATUS_STARTED: self.server_status_image_label.setPixmap(QtGui.QPixmap.fromImage(self.server_status_image_started)) self.server_status_label.setText(strings._('gui_status_indicator_share_started')) @@ -239,7 +246,10 @@ class OnionShareGui(QtWidgets.QMainWindow): self.server_status_label.setText(strings._('gui_status_indicator_receive_stopped')) elif self.receive_mode.server_status.status == ServerStatus.STATUS_WORKING: self.server_status_image_label.setPixmap(QtGui.QPixmap.fromImage(self.server_status_image_working)) - self.server_status_label.setText(strings._('gui_status_indicator_receive_working')) + if self.receive_mode.server_status.autostart_timer_datetime: + self.server_status_label.setText(strings._('gui_status_indicator_receive_scheduled')) + else: + self.server_status_label.setText(strings._('gui_status_indicator_receive_working')) elif self.receive_mode.server_status.status == ServerStatus.STATUS_STARTED: self.server_status_image_label.setPixmap(QtGui.QPixmap.fromImage(self.server_status_image_started)) self.server_status_label.setText(strings._('gui_status_indicator_receive_started')) @@ -309,10 +319,16 @@ class OnionShareGui(QtWidgets.QMainWindow): self.receive_mode.on_reload_settings() self.status_bar.clearMessage() - # If we switched off the shutdown timeout setting, ensure the widget is hidden. - if not self.common.settings.get('shutdown_timeout'): - self.share_mode.server_status.shutdown_timeout_container.hide() - self.receive_mode.server_status.shutdown_timeout_container.hide() + # If we switched off the auto-stop timer setting, ensure the widget is hidden. + if not self.common.settings.get('autostop_timer'): + self.share_mode.server_status.autostop_timer_container.hide() + self.receive_mode.server_status.autostop_timer_container.hide() + # If we switched off the auto-start timer setting, ensure the widget is hidden. + if not self.common.settings.get('autostart_timer'): + self.share_mode.server_status.autostart_timer_datetime = None + self.receive_mode.server_status.autostart_timer_datetime = None + self.share_mode.server_status.autostart_timer_container.hide() + self.receive_mode.server_status.autostart_timer_container.hide() d = SettingsDialog(self.common, self.onion, self.qtapp, self.config, self.local_only) d.settings_saved.connect(reload_settings) |