def initialize_settings_page(self, version_history): self.version_history = version_history if DARWIN: self.window().minimize_to_tray_checkbox.setHidden(True) self.window().settings_tab.initialize() connect(self.window().settings_tab.clicked_tab_button, self.clicked_tab_button) connect(self.window().settings_save_button.clicked, self.save_settings) connect(self.window().download_location_chooser_button.clicked, self.on_choose_download_dir_clicked) connect(self.window().watch_folder_chooser_button.clicked, self.on_choose_watch_dir_clicked) connect(self.window().channel_autocommit_checkbox.stateChanged, self.on_channel_autocommit_checkbox_changed) connect(self.window().family_filter_checkbox.stateChanged, self.on_family_filter_checkbox_changed) connect(self.window().developer_mode_enabled_checkbox.stateChanged, self.on_developer_mode_checkbox_changed) connect(self.window().use_monochrome_icon_checkbox.stateChanged, self.on_use_monochrome_icon_checkbox_changed) connect(self.window().minimize_to_tray_checkbox.stateChanged, self.on_minimize_to_tray_changed) connect(self.window().download_settings_anon_checkbox.stateChanged, self.on_anon_download_state_changed) connect(self.window().log_location_chooser_button.clicked, self.on_choose_log_dir_clicked) connect(self.window().btn_remove_old_state_dir.clicked, self.on_remove_version_dirs) self.window().language_selector.addItems(self.lang_list) selected_lang_code = self.window().gui_settings.value('translation', None) if selected_lang_code is not None: for lang_name, lang_code in AVAILABLE_TRANSLATIONS.items(): if selected_lang_code == lang_code: self.window().language_selector.setCurrentIndex(self.lang_list.index(lang_name)) break self.update_stacked_widget_height()
def __init__(self): QWidget.__init__(self) self.settings = None self.version_history = None self.lang_list = sorted([ lang_name for lang_name, lang_code in AVAILABLE_TRANSLATIONS.items() ]) self.lang_list.insert(0, tr("System default"))