Merge branch '528_disable_check_for_updates_if_disconnected' of https://github.com/mig5/onionshare into mig5-528_disable_check_for_updates_if_disconnected

This commit is contained in:
Micah Lee 2018-01-14 19:00:39 -08:00
commit c29259cdea
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73

View File

@ -114,6 +114,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()
@ -645,8 +648,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)