From 2a949802d223860b34886fc26b94575378ad8d67 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Mon, 28 Jan 2019 20:30:05 -0800 Subject: [PATCH] Separete onion settings into their own group, and remove css that was breaking the look of the "Copy HidServAuth" button --- onionshare/common.py | 7 ------- onionshare_gui/settings_dialog.py | 28 ++++++++++++++++++---------- share/locale/en.json | 3 ++- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/onionshare/common.py b/onionshare/common.py index 49c69ab5..fcb9ca6d 100644 --- a/onionshare/common.py +++ b/onionshare/common.py @@ -398,13 +398,6 @@ class Common(object): 'settings_connect_to_tor': """ QLabel { font-style: italic; - }""", - - # For some reason, this prevents extra padding around the v2 onion - # settings when viewing in macOS - 'settings_onion_settings': """ - QWidget { - border: 0; }""" } diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index 7cec8b92..75a2f59b 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -52,7 +52,7 @@ class SettingsDialog(QtWidgets.QDialog): self.system = platform.system() - # General options + # General settings # Use a slug or not ('public mode') self.public_mode_checkbox = QtWidgets.QCheckBox() @@ -88,6 +88,15 @@ class SettingsDialog(QtWidgets.QDialog): self.shutdown_timeout_widget = QtWidgets.QWidget() self.shutdown_timeout_widget.setLayout(shutdown_timeout_layout) + # General settings layout + general_group_layout = QtWidgets.QVBoxLayout() + general_group_layout.addWidget(self.public_mode_widget) + general_group_layout.addWidget(self.shutdown_timeout_widget) + general_group = QtWidgets.QGroupBox(strings._("gui_settings_general_label")) + general_group.setLayout(general_group_layout) + + # Onion settings + # Label telling user to connect to Tor for onion service settings 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']) @@ -162,17 +171,15 @@ class SettingsDialog(QtWidgets.QDialog): onion_settings_layout.addWidget(self.hidservauth_details) onion_settings_layout.addWidget(self.hidservauth_copy_button) self.onion_settings_widget = QtWidgets.QWidget() - self.onion_settings_widget.setStyleSheet(self.common.css['settings_onion_settings']) 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(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) + # Onion settings layout + onion_group_layout = QtWidgets.QVBoxLayout() + onion_group_layout.addWidget(self.connect_to_tor_label) + onion_group_layout.addWidget(self.onion_settings_widget) + onion_group = QtWidgets.QGroupBox(strings._("gui_settings_onion_label")) + onion_group.setLayout(onion_group_layout) + # Sharing options @@ -445,6 +452,7 @@ class SettingsDialog(QtWidgets.QDialog): # Layout left_col_layout = QtWidgets.QVBoxLayout() left_col_layout.addWidget(general_group) + left_col_layout.addWidget(onion_group) left_col_layout.addWidget(sharing_group) left_col_layout.addWidget(receiving_group) left_col_layout.addWidget(autoupdate_group) diff --git a/share/locale/en.json b/share/locale/en.json index 3ad2efda..f7af9a80 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -56,13 +56,14 @@ "gui_settings_window_title": "Settings", "gui_settings_whats_this": "What's this?", "gui_settings_stealth_option": "Use client authorization", - "gui_settings_stealth_hidservauth_string": "Having saved your private key for reuse, means you can now\nclick to copy your HidServAuth.", + "gui_settings_stealth_hidservauth_string": "Having saved your private key for reuse, means you can now click to copy your HidServAuth.", "gui_settings_autoupdate_label": "Check for new version", "gui_settings_autoupdate_option": "Notify me when a new version is available", "gui_settings_autoupdate_timestamp": "Last checked: {}", "gui_settings_autoupdate_timestamp_never": "Never", "gui_settings_autoupdate_check_button": "Check for New Version", "gui_settings_general_label": "General settings", + "gui_settings_onion_label": "Onion settings", "gui_settings_sharing_label": "Sharing settings", "gui_settings_close_after_first_download_option": "Stop sharing after files have been sent", "gui_settings_connection_type_label": "How should OnionShare connect to Tor?",