summaryrefslogtreecommitdiff
path: root/onionshare_gui
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2018-12-05 23:05:25 -0800
committerMicah Lee <micah@micahflee.com>2018-12-05 23:05:25 -0800
commit300434e5ec452a5c622419a929694f698a83414c (patch)
treed370047400838d20e7383ca995abdb4a1609376a /onionshare_gui
parent16e301af8d42c7a911539ed0945db2c6918063de (diff)
downloadonionshare-300434e5ec452a5c622419a929694f698a83414c.tar.gz
onionshare-300434e5ec452a5c622419a929694f698a83414c.zip
Update settings dialog tests to use an OnionStub instead of an Onion, and test different states of tor (authenticate and not, supports v3 and not)
Diffstat (limited to 'onionshare_gui')
-rw-r--r--onionshare_gui/settings_dialog.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py
index 1ff20b31..92c84262 100644
--- a/onionshare_gui/settings_dialog.py
+++ b/onionshare_gui/settings_dialog.py
@@ -89,8 +89,8 @@ class SettingsDialog(QtWidgets.QDialog):
self.shutdown_timeout_widget.setLayout(shutdown_timeout_layout)
# Label telling user to connect to Tor for onion service settings
- connect_to_tor_label = QtWidgets.QLabel(strings._("gui_connect_to_tor_for_onion_settings"))
- connect_to_tor_label.setStyleSheet(self.common.css['settings_connect_to_tor'])
+ self.connect_to_tor_label = QtWidgets.QLabel(strings._("gui_connect_to_tor_for_onion_settings"))
+ self.connect_to_tor_label.setStyleSheet(self.common.css['settings_connect_to_tor'])
# Whether or not to use legacy v2 onions
self.use_legacy_v2_onions_checkbox = QtWidgets.QCheckBox()
@@ -161,15 +161,15 @@ class SettingsDialog(QtWidgets.QDialog):
onion_settings_layout.addWidget(self.use_stealth_widget)
onion_settings_layout.addWidget(hidservauth_details)
onion_settings_layout.addWidget(self.hidservauth_copy_button)
- onion_settings_widget = QtWidgets.QWidget()
- onion_settings_widget.setLayout(onion_settings_layout)
+ self.onion_settings_widget = QtWidgets.QWidget()
+ self.onion_settings_widget.setLayout(onion_settings_layout)
# General options layout
general_group_layout = QtWidgets.QVBoxLayout()
general_group_layout.addWidget(self.public_mode_widget)
general_group_layout.addWidget(self.shutdown_timeout_widget)
- general_group_layout.addWidget(connect_to_tor_label)
- general_group_layout.addWidget(onion_settings_widget)
+ general_group_layout.addWidget(self.connect_to_tor_label)
+ general_group_layout.addWidget(self.onion_settings_widget)
general_group = QtWidgets.QGroupBox(strings._("gui_settings_general_label"))
general_group.setLayout(general_group_layout)
@@ -471,7 +471,9 @@ class SettingsDialog(QtWidgets.QDialog):
self.setLayout(layout)
self.cancel_button.setFocus()
+ self.reload_settings()
+ def reload_settings(self):
# Load settings, and fill them in
self.old_settings = Settings(self.common, self.config)
self.old_settings.load()
@@ -593,8 +595,8 @@ class SettingsDialog(QtWidgets.QDialog):
# If we're connected to Tor, show onion service settings, show label if not
if self.onion.is_authenticated():
- connect_to_tor_label.hide()
- onion_settings_widget.show()
+ self.connect_to_tor_label.hide()
+ self.onion_settings_widget.show()
# If v3 onion services are supported, allow using legacy mode
if self.onion.supports_v3_onions:
@@ -605,8 +607,8 @@ class SettingsDialog(QtWidgets.QDialog):
self.use_legacy_v2_onions_widget.hide()
self.use_legacy_v2_onions_checkbox_clicked(True)
else:
- connect_to_tor_label.show()
- onion_settings_widget.hide()
+ self.connect_to_tor_label.show()
+ self.onion_settings_widget.hide()
def connection_type_bundled_toggled(self, checked):