diff --git a/onionshare_gui/main_window.py b/onionshare_gui/main_window.py index a518ab33..9d0840a2 100644 --- a/onionshare_gui/main_window.py +++ b/onionshare_gui/main_window.py @@ -237,14 +237,10 @@ class MainWindow(QtWidgets.QMainWindow): self.website_mode.server_status.autostart_timer_container.hide() d = SettingsDialog(self.common) - d.settings_saved.connect(reload_settings) + # d.settings_saved.connect(reload_settings) + # TODO: move the reload_settings logic into tabs d.exec_() - # When settings close, refresh the server status UI - self.share_mode.server_status.update() - self.receive_mode.server_status.update() - self.website_mode.server_status.update() - def check_for_updates(self): """ Check for updates in a new thread, if enabled. diff --git a/onionshare_gui/tab/tab.py b/onionshare_gui/tab/tab.py index d495d64e..cf3050d0 100644 --- a/onionshare_gui/tab/tab.py +++ b/onionshare_gui/tab/tab.py @@ -496,12 +496,15 @@ class Tab(QtWidgets.QWidget): self.status_bar.clearMessage() def get_mode(self): - if self.mode == self.common.gui.MODE_SHARE: - return self.share_mode - elif self.mode == self.common.gui.MODE_RECEIVE: - return self.receive_mode + if self.mode: + if self.mode == self.common.gui.MODE_SHARE: + return self.share_mode + elif self.mode == self.common.gui.MODE_RECEIVE: + return self.receive_mode + else: + return self.website_mode else: - return self.website_mode + return None def persistence_button_clicked(self): self.common.log("Tab", "persistence_button_clicked") diff --git a/onionshare_gui/tab_widget.py b/onionshare_gui/tab_widget.py index b3857cf4..11dcfec6 100644 --- a/onionshare_gui/tab_widget.py +++ b/onionshare_gui/tab_widget.py @@ -127,8 +127,9 @@ class TabWidget(QtWidgets.QTabWidget): """ for tab_id in self.tabs: mode = self.tabs[tab_id].get_mode() - if mode.server_status.status != mode.server_status.STATUS_STOPPED: - return True + if mode: + if mode.server_status.status != mode.server_status.STATUS_STOPPED: + return True return False def resizeEvent(self, event):