From de57a2ce551cbebd3644bcbdffacb8d30f0e005b Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 8 Dec 2019 10:29:00 -0800 Subject: [PATCH] After you start a server in a tab, you can't change legacy/client auth settings, because this would require changing the saved onion key --- onionshare_gui/tab/mode/mode_settings_widget.py | 11 +++++++++++ onionshare_gui/tab/server_status.py | 2 ++ 2 files changed, 13 insertions(+) diff --git a/onionshare_gui/tab/mode/mode_settings_widget.py b/onionshare_gui/tab/mode/mode_settings_widget.py index a5e42d6d..34335494 100644 --- a/onionshare_gui/tab/mode/mode_settings_widget.py +++ b/onionshare_gui/tab/mode/mode_settings_widget.py @@ -185,6 +185,17 @@ class ModeSettingsWidget(QtWidgets.QWidget): else: self.client_auth_checkbox.hide() + # If the server has been started in the past, prevent changing legacy option + if self.settings.get("onion", "private_key"): + if self.legacy_checkbox.isChecked(): + # If using legacy, disable legacy and client auth options + self.legacy_checkbox.setEnabled(False) + self.client_auth_checkbox.setEnabled(False) + else: + # If using v3, hide legacy and client auth options + self.legacy_checkbox.hide() + self.client_auth_checkbox.hide() + def persistent_checkbox_clicked(self): self.settings.set("persistent", "enabled", self.persistent_checkbox.isChecked()) self.settings.set("persistent", "mode", self.tab.mode) diff --git a/onionshare_gui/tab/server_status.py b/onionshare_gui/tab/server_status.py index 5f58877c..0fbc11b6 100644 --- a/onionshare_gui/tab/server_status.py +++ b/onionshare_gui/tab/server_status.py @@ -225,6 +225,8 @@ class ServerStatus(QtWidgets.QWidget): self.copy_url_button.hide() self.copy_hidservauth_button.hide() + self.mode_settings_widget.update_ui() + # Button if ( self.mode == self.common.gui.MODE_SHARE