summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2019-01-28 21:02:47 -0800
committerGitHub <noreply@github.com>2019-01-28 21:02:47 -0800
commitf1343b359260db810d0752cffa3fa5271af3c960 (patch)
treee8db7c04f6d202fb0ef0d479154d83aeecb91f27
parent6d3302afb23b81a74d68d3c6e9b4aecf9a87bc9d (diff)
parent2a949802d223860b34886fc26b94575378ad8d67 (diff)
downloadonionshare-f1343b359260db810d0752cffa3fa5271af3c960.tar.gz
onionshare-f1343b359260db810d0752cffa3fa5271af3c960.zip
Merge pull request #888 from micahflee/settings_crash
Minor settings fixes
-rw-r--r--onionshare/common.py7
-rw-r--r--onionshare_gui/settings_dialog.py40
-rw-r--r--share/locale/en.json3
3 files changed, 26 insertions, 24 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 1fe6dc53..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'])
@@ -144,10 +153,10 @@ class SettingsDialog(QtWidgets.QDialog):
self.use_stealth_widget = QtWidgets.QWidget()
self.use_stealth_widget.setLayout(use_stealth_layout)
- hidservauth_details = QtWidgets.QLabel(strings._('gui_settings_stealth_hidservauth_string'))
- hidservauth_details.setWordWrap(True)
- hidservauth_details.setMinimumSize(hidservauth_details.sizeHint())
- hidservauth_details.hide()
+ self.hidservauth_details = QtWidgets.QLabel(strings._('gui_settings_stealth_hidservauth_string'))
+ self.hidservauth_details.setWordWrap(True)
+ self.hidservauth_details.setMinimumSize(self.hidservauth_details.sizeHint())
+ self.hidservauth_details.hide()
self.hidservauth_copy_button = QtWidgets.QPushButton(strings._('gui_copy_hidservauth'))
self.hidservauth_copy_button.clicked.connect(self.hidservauth_copy_button_clicked)
@@ -159,20 +168,18 @@ class SettingsDialog(QtWidgets.QDialog):
onion_settings_layout.addWidget(self.use_legacy_v2_onions_widget)
onion_settings_layout.addWidget(self.save_private_key_widget)
onion_settings_layout.addWidget(self.use_stealth_widget)
- onion_settings_layout.addWidget(hidservauth_details)
+ 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)
@@ -523,7 +531,7 @@ class SettingsDialog(QtWidgets.QDialog):
# Legacy v2 mode is forced on if Stealth is enabled
self.use_legacy_v2_onions_checkbox.setEnabled(False)
if save_private_key and self.old_settings.get('hidservauth_string') != "":
- hidservauth_details.show()
+ self.hidservauth_details.show()
self.hidservauth_copy_button.show()
else:
self.stealth_checkbox.setCheckState(QtCore.Qt.Unchecked)
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": "<a href='{0:s}'>What's this?</a>",
"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?",