From 23c55bc95b2c99a6efad03f0c6c0fda91c18cf26 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 30 Sep 2018 16:23:46 -0700 Subject: [PATCH] Change how language selection setting looks --- onionshare_gui/settings_dialog.py | 13 ++++++------- share/locale/en.json | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/onionshare_gui/settings_dialog.py b/onionshare_gui/settings_dialog.py index 5966b954..709ab059 100644 --- a/onionshare_gui/settings_dialog.py +++ b/onionshare_gui/settings_dialog.py @@ -228,20 +228,19 @@ class SettingsDialog(QtWidgets.QDialog): autoupdate_group.hide() # Language settings - - # Populate the dropdown with all of OnionShare's available languages + language_label = QtWidgets.QLabel(strings._("gui_settings_language_label", True)) self.language_combobox = QtWidgets.QComboBox() + # Populate the dropdown with all of OnionShare's available languages language_names_to_locales = {v: k for k, v in self.common.settings.available_locales.items()} language_names = list(language_names_to_locales) language_names.sort() for language_name in language_names: locale = language_names_to_locales[language_name] self.language_combobox.addItem(language_name, QtCore.QVariant(locale)) - - language_layout = QtWidgets.QVBoxLayout() + language_layout = QtWidgets.QHBoxLayout() + language_layout.addWidget(language_label) language_layout.addWidget(self.language_combobox) - language_group = QtWidgets.QGroupBox(strings._("gui_settings_language_label", True)) - language_group.setLayout(language_layout) + language_layout.addStretch() # Connection type: either automatic, control port, or socket file @@ -447,7 +446,7 @@ class SettingsDialog(QtWidgets.QDialog): left_col_layout.addWidget(sharing_group) left_col_layout.addWidget(receiving_group) left_col_layout.addWidget(autoupdate_group) - left_col_layout.addWidget(language_group) + left_col_layout.addLayout(language_layout) left_col_layout.addStretch() right_col_layout = QtWidgets.QVBoxLayout() diff --git a/share/locale/en.json b/share/locale/en.json index 903f8945..05830e62 100644 --- a/share/locale/en.json +++ b/share/locale/en.json @@ -181,5 +181,5 @@ "gui_upload_finished_range": "Uploaded {} to {}", "gui_upload_finished": "Uploaded {}", "gui_open_folder_error_nautilus": "Cannot open folder because nautilus is not available. The file is here: {}", - "gui_settings_language_label": "Select language" + "gui_settings_language_label": "Preferred language" }