Use MainAction.* to define DEFAULT_TOOLBAR_LAYOUT

This commit is contained in:
Laurent Monin
2024-05-05 12:10:25 +02:00
parent 26c07b6c44
commit caad3df4dd
2 changed files with 31 additions and 19 deletions

View File

@@ -49,6 +49,7 @@ from picard.i18n import N_
from picard.util import system_supports_long_paths
from picard.util.cdrom import get_default_cdrom_drives
from picard.ui.enums import MainAction
from picard.ui.theme import UiTheme
@@ -101,24 +102,24 @@ DEFAULT_STARTING_DIR = QStandardPaths.writableLocation(QStandardPaths.StandardLo
DEFAULT_THEME_NAME = str(UiTheme.DEFAULT)
DEFAULT_TOOLBAR_LAYOUT = [
'add_directory_action',
'add_files_action',
'separator',
'cluster_action',
'separator',
'autotag_action',
'analyze_action',
'browser_lookup_action',
'separator',
'save_action',
'view_info_action',
'remove_action',
'separator',
'cd_lookup_action',
'separator',
'submit_acoustid_action',
]
DEFAULT_TOOLBAR_LAYOUT = (
MainAction.ADD_DIRECTORY,
MainAction.ADD_FILES,
'-',
MainAction.CLUSTER,
'-',
MainAction.AUTOTAG,
MainAction.ANALYZE,
MainAction.BROWSER_LOOKUP,
'-',
MainAction.SAVE,
MainAction.VIEW_INFO,
MainAction.REMOVE,
'-',
MainAction.CD_LOOKUP,
'-',
MainAction.SUBMIT_ACOUSTID,
)
DEFAULT_TOP_TAGS = [
'title',

View File

@@ -236,7 +236,18 @@ Option('setting', 'interface_colors_dark', InterfaceColors(dark_theme=True).get_
# picard/ui/options/interface_toolbar.py
# Action Toolbar
ListOption('setting', 'toolbar_layout', DEFAULT_TOOLBAR_LAYOUT, title=N_("Layout of the tool bar"))
def make_default_toolbar_layout():
for e in DEFAULT_TOOLBAR_LAYOUT:
if e == '-':
yield e
else:
# we want the string matching the MainAction
yield e.value
ListOption('setting', 'toolbar_layout', list(make_default_toolbar_layout()), title=N_("Layout of the tool bar"))
# picard/ui/options/interface_top_tags.py
# Top Tags