diff --git a/picard/profile.py b/picard/profile.py index 821baf589ab..32db8068e3e 100644 --- a/picard/profile.py +++ b/picard/profile.py @@ -43,17 +43,7 @@ class UserProfileGroups(): # Each item in "settings" is a tuple of the setting key, the display title, and a list of the names of the widgets to highlight SETTINGS_GROUPS['general'] = { 'title': N_("General"), - 'settings': [ - SettingDesc('server_host', ['server_host']), - SettingDesc('server_port', ['server_port']), - SettingDesc('analyze_new_files', ['analyze_new_files']), - SettingDesc('cluster_new_files', ['cluster_new_files']), - SettingDesc('ignore_file_mbids', ['ignore_file_mbids']), - SettingDesc('check_for_plugin_updates', ['check_for_plugin_updates']), - SettingDesc('check_for_updates', ['check_for_updates']), - SettingDesc('update_check_days', ['update_check_days']), - SettingDesc('update_level', ['update_level']), - ], + 'settings': [], } SETTINGS_GROUPS['metadata'] = { @@ -269,3 +259,7 @@ def get_setting_groups_list(cls): str: Key """ yield from cls.SETTINGS_GROUPS + + +def register_profile_highlights(group, option, higlights): + UserProfileGroups.SETTINGS_GROUPS[group]['settings'].append(SettingDesc(option, higlights)) diff --git a/picard/ui/options/general.py b/picard/ui/options/general.py index 329455fb14e..7c084783fb4 100644 --- a/picard/ui/options/general.py +++ b/picard/ui/options/general.py @@ -41,6 +41,7 @@ gettext as _, gettext_constants, ) +from picard.profile import register_profile_highlights from picard.util.mbserver import is_official_server from picard.ui.options import ( @@ -75,6 +76,15 @@ def __init__(self, parent=None): self.ui.login_error.setStyleSheet(self.STYLESHEET_ERROR) self.ui.login_error.hide() self.update_login_logout() + register_profile_highlights('general', 'server_host', ['server_host']) + register_profile_highlights('general', 'server_port', ['server_port']) + register_profile_highlights('general', 'analyze_new_files', ['analyze_new_files']) + register_profile_highlights('general', 'cluster_new_files', ['cluster_new_files']) + register_profile_highlights('general', 'ignore_file_mbids', ['ignore_file_mbids']) + register_profile_highlights('general', 'check_for_plugin_updates', ['check_for_plugin_updates']) + register_profile_highlights('general', 'check_for_updates', ['check_for_updates']) + register_profile_highlights('general', 'update_check_days', ['update_check_days']) + register_profile_highlights('general', 'update_level', ['update_level']) def load(self): config = get_config()