From c426cfceb2b9cebae8dcb6e85305438ebcb17997 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sat, 2 Nov 2019 11:43:05 -0700 Subject: [PATCH] Rename mode_settings_widget to be more clear, and fix one place that was still using tab_settings --- onionshare_gui/tab/mode/__init__.py | 6 +++--- onionshare_gui/tab/mode/receive_mode/__init__.py | 2 +- onionshare_gui/tab/mode/share_mode/__init__.py | 2 +- onionshare_gui/tab/mode/website_mode/__init__.py | 4 +++- onionshare_gui/tab/tab.py | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/onionshare_gui/tab/mode/__init__.py b/onionshare_gui/tab/mode/__init__.py index 8399c962..cae046e0 100644 --- a/onionshare_gui/tab/mode/__init__.py +++ b/onionshare_gui/tab/mode/__init__.py @@ -73,15 +73,15 @@ class Mode(QtWidgets.QWidget): self.header_label.setStyleSheet(self.common.gui.css["mode_header_label"]) self.header_label.setAlignment(QtCore.Qt.AlignHCenter) - self.mode_settings = ModeSettingsWidget( + self.mode_settings_widget = ModeSettingsWidget( self.common, self.tab.tab_id, self.tab.mode_settings ) - self.mode_settings.change_persistent.connect(self.change_persistent) + self.mode_settings_widget.change_persistent.connect(self.change_persistent) header_layout = QtWidgets.QVBoxLayout() header_layout.setContentsMargins(0, 0, 0, 0) header_layout.addWidget(self.header_label) - header_layout.addWidget(self.mode_settings) + header_layout.addWidget(self.mode_settings_widget) self.header = QtWidgets.QWidget() self.header.setLayout(header_layout) diff --git a/onionshare_gui/tab/mode/receive_mode/__init__.py b/onionshare_gui/tab/mode/receive_mode/__init__.py index 3a9c2fbe..665fceba 100644 --- a/onionshare_gui/tab/mode/receive_mode/__init__.py +++ b/onionshare_gui/tab/mode/receive_mode/__init__.py @@ -57,7 +57,7 @@ class ReceiveMode(Mode): data_dir_layout.addWidget(self.data_dir_lineedit) data_dir_layout.addWidget(data_dir_button) - self.mode_settings.mode_specific_layout.addLayout(data_dir_layout) + self.mode_settings_widget.mode_specific_layout.addLayout(data_dir_layout) # Server status self.server_status.set_mode("receive") diff --git a/onionshare_gui/tab/mode/share_mode/__init__.py b/onionshare_gui/tab/mode/share_mode/__init__.py index 57d6475c..fc94944b 100644 --- a/onionshare_gui/tab/mode/share_mode/__init__.py +++ b/onionshare_gui/tab/mode/share_mode/__init__.py @@ -59,7 +59,7 @@ class ShareMode(Mode): self.autostop_sharing_checkbox.setText( strings._("mode_settings_share_autostop_sharing_checkbox") ) - self.mode_settings.mode_specific_layout.addWidget( + self.mode_settings_widget.mode_specific_layout.addWidget( self.autostop_sharing_checkbox ) diff --git a/onionshare_gui/tab/mode/website_mode/__init__.py b/onionshare_gui/tab/mode/website_mode/__init__.py index e6ed785d..82d7b310 100644 --- a/onionshare_gui/tab/mode/website_mode/__init__.py +++ b/onionshare_gui/tab/mode/website_mode/__init__.py @@ -59,7 +59,9 @@ class WebsiteMode(Mode): self.disable_csp_checkbox.setText( strings._("mode_settings_website_disable_csp_checkbox") ) - self.mode_settings.mode_specific_layout.addWidget(self.disable_csp_checkbox) + self.mode_settings_widget.mode_specific_layout.addWidget( + self.disable_csp_checkbox + ) # File selection self.file_selection = FileSelection(self.common, self) diff --git a/onionshare_gui/tab/tab.py b/onionshare_gui/tab/tab.py index 60809b57..e1913071 100644 --- a/onionshare_gui/tab/tab.py +++ b/onionshare_gui/tab/tab.py @@ -496,7 +496,7 @@ class Tab(QtWidgets.QWidget): if self.mode is None: return True - if self.tab_settings["persistent"]["enabled"]: + if self.mode_settings.get("persistent", "enabled"): dialog_text = strings._("gui_close_tab_warning_persistent_description") else: server_status = self.get_mode().server_status