From 249f9fa18bb0a7a58d62c265bd3666ab4d3650f2 Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Wed, 3 Jan 2018 11:16:50 +1100 Subject: [PATCH 1/2] #528 disable the 'Check for Updates' button in the SettingsDialog if Tor is not connected --- onionshare_gui/settings_dialog.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index df806a06..105b1e3d 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -96,6 +96,9 @@ class SettingsDialog(QtWidgets.QDialog): # Check for updates button self.check_for_updates_button = QtWidgets.QPushButton(strings._('gui_settings_autoupdate_check_button', True)) self.check_for_updates_button.clicked.connect(self.check_for_updates) + # We can't check for updates if not connected to Tor + if not self.onion.connected_to_tor: + self.check_for_updates_button.setEnabled(False) # Autoupdate options layout autoupdate_group_layout = QtWidgets.QVBoxLayout() From cdb7a4df718af24dddc9e0115fd4cce8d7f2c6cb Mon Sep 17 00:00:00 2001 From: Miguel Jacq Date: Thu, 4 Jan 2018 08:43:43 +1100 Subject: [PATCH 2/2] Don't re-enable the Check for Updates button after testing Tor connection, if the main Tor connection is still not active --- onionshare_gui/settings_dialog.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index 105b1e3d..38cf36d3 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -596,8 +596,11 @@ class SettingsDialog(QtWidgets.QDialog): def _enable_buttons(self): common.log('SettingsDialog', '_enable_buttons') - - self.check_for_updates_button.setEnabled(True) + # We can't check for updates if we're still not connected to Tor + if not self.onion.connected_to_tor: + self.check_for_updates_button.setEnabled(False) + else: + self.check_for_updates_button.setEnabled(True) self.connection_type_test_button.setEnabled(True) self.save_button.setEnabled(True) self.cancel_button.setEnabled(True)