コード例 #1
0
ファイル: profiles.py プロジェクト: maestromusic/maestro
def init():
    global defaultOptions, defaultProfileType
    category = DelegateProfileCategory(
        name="delegates",
        title=translate("Delegates", "Item display"),
        storageOption=config.getOption(config.storage, 'gui.delegates'),
        description=translate(
            "Delegates",
            "Configure how elements are rendered in treeviews like browser, editor and playlist."),
        iconName='preferences-delegates',
    )
    profiles.addCategory(category)
    # List of available options for delegates. This list in particular defines the default values.
    defaultOptions = [DelegateOption(*data) for data in [
        ("fontSize", translate("Delegates", "Fontsize"), "int", 8),
        ("showMajorAncestors", translate("Delegates", "Mention major parent containers which are not in the tree."), "bool", False),
        ("showAllAncestors", translate("Delegates", "Mention all parent containers which are not in the tree."), "bool", False),
        ("showType", translate("Delegates", "Display element type"), "bool", False),
        ("showPositions", translate("Delegates", "Display position numbers"), "bool", True),
        ("showPaths", translate("Delegates", "Display paths"), "bool", False),
        ("showFlagIcons", translate("Delegates", "Display flag icons"), "bool", True),
        ("removeParentFlags", translate("Delegates", "Remove flags which appear in ancestor elements"), "bool", True),
        ("fitInTitleRowData", translate("Delegates", "This datapiece will be displayed next to the title if it fits"), "datapiece", None),
        ("appendRemainingTags", translate("Delegates", "Append all tags that are not listed above"), "bool", False),
        #("hideParentFlags",translate("Delegates","Hide flags that appear in parent elements"),"bool",True),
        #("maxRowsTag",translate("Delegates","Maximal number of rows per tag"),"int",4),
        #("maxRowsElement",translate("Delegates","Maximal number of rows per element"),"int",50),
        ("coverSize", translate("Delegates", "Size of covers"), "int", 40)
    ]]

    # This type is useful to create profiles which are not configurable
    defaultProfileType = ProfileType(
        name='default', title=translate('Delegates', 'Standard'),
        options=collections.OrderedDict([(option.name, option) for option in defaultOptions]),
        leftData=[], rightData=[])
コード例 #2
0
ファイル: player.py プロジェクト: maestromusic/maestro
def init():
    profiles.addCategory(profiles.TypedProfileCategory(
        name='playback', title=translate('PlayerBackend', 'Playback'),
        storageOption=config.getOption(config.storage, 'player.profiles'),
        description=translate('PlayerBackend',
                              'Configure backends for audio playback (e.g. local playback)'),
        iconName='preferences-sound')
    )
コード例 #3
0
def init():
    profiles.addCategory(
        profiles.TypedProfileCategory(
            name='playback',
            title=translate('PlayerBackend', 'Playback'),
            storageOption=config.getOption(config.storage, 'player.profiles'),
            description=translate(
                'PlayerBackend',
                'Configure backends for audio playback (e.g. local playback)'),
            iconName='preferences-sound'))
コード例 #4
0
ファイル: plugin.py プロジェクト: maestromusic/maestro
def enable():
    profiles.addCategory(profiles.ProfileCategory(
        name='renamer', title=translate('Renamer', 'Renamer'),
        storageOption=config.getOption(config.storage, 'renamer.profiles'),
        profileClass=GrammarRenamer, iconName='edit-rename')
    )
    
    from .gui import RenameFilesAction
    from maestro.widgets import editor, browser
    RenameFilesAction.register('renamer', context='plugins',
                               shortcut=translate('RenameFilesAction', 'Ctrl+R'))
    editor.EditorTreeView.addActionDefinition('renamer')
    browser.BrowserTreeView.addActionDefinition('renamer')
コード例 #5
0
ファイル: plugin.py プロジェクト: maestromusic/maestro
def enable():
    global _action
    profiles.addCategory(profiles.ProfileCategory(
        name='wtf', title=translate('wtf', 'Export'), iconName='actions-export',
        storageOption=config.getOption(config.storage, 'wtf.profiles'),
        profileClass=Profile
    ))
    
    _action = QtWidgets.QAction(application.mainWindow)
    _action.setText(QtWidgets.QApplication.translate("wtf", "Export..."))
    _action.triggered.connect(Dialog.execute)
    global _sqlAction
    _sqlAction = QtWidgets.QAction(application.mainWindow)
    _sqlAction.setText("Export SQLite...")
    _sqlAction.triggered.connect(exportSQLite)
コード例 #6
0
def init():
    profileCategory = profiles.TypedProfileCategory(
        name='albumguesser', title=translate('Albumguesser', 'Album Guesser'),
        description=translate('Albumguesser', 'Configure automated generation of containers for '
                                              'typical albums, works, and collections.'),
        storageOption=config.getOption(config.storage, 'editor.albumguesser_profiles'),
        iconName='container',
    )
    profiles.addCategory(profileCategory)
    profileCategory.addType(profiles.ProfileType(
        name='standard', title=translate('Albumguesser', 'Tag-Based Guesser'),
        profileClass=StandardGuesser)
    )
    if len(profileCategory.profiles()) == 0:
        profileCategory.addProfile(translate('Albumguesser', 'Default'),
                                   type=profileCategory.getType('standard'))
コード例 #7
0
def enable():
    global _action
    profiles.addCategory(
        profiles.ProfileCategory(name='wtf',
                                 title=translate('wtf', 'Export'),
                                 iconName='actions-export',
                                 storageOption=config.getOption(
                                     config.storage, 'wtf.profiles'),
                                 profileClass=Profile))

    _action = QtWidgets.QAction(application.mainWindow)
    _action.setText(QtWidgets.QApplication.translate("wtf", "Export..."))
    _action.triggered.connect(Dialog.execute)
    global _sqlAction
    _sqlAction = QtWidgets.QAction(application.mainWindow)
    _sqlAction.setText("Export SQLite...")
    _sqlAction.triggered.connect(exportSQLite)
コード例 #8
0
def enable():
    profiles.addCategory(
        profiles.ProfileCategory(name='renamer',
                                 title=translate('Renamer', 'Renamer'),
                                 storageOption=config.getOption(
                                     config.storage, 'renamer.profiles'),
                                 profileClass=GrammarRenamer,
                                 iconName='edit-rename'))

    from .gui import RenameFilesAction
    from maestro.widgets import editor, browser
    RenameFilesAction.register('renamer',
                               context='plugins',
                               shortcut=translate('RenameFilesAction',
                                                  'Ctrl+R'))
    editor.EditorTreeView.addActionDefinition('renamer')
    browser.BrowserTreeView.addActionDefinition('renamer')
コード例 #9
0
def init():
    global defaultOptions, defaultProfileType
    category = DelegateProfileCategory(
        name="delegates",
        title=translate("Delegates", "Item display"),
        storageOption=config.getOption(config.storage, 'gui.delegates'),
        description=translate(
            "Delegates",
            "Configure how elements are rendered in treeviews like browser, editor and playlist."
        ),
        iconName='preferences-delegates',
    )
    profiles.addCategory(category)
    # List of available options for delegates. This list in particular defines the default values.
    defaultOptions = [
        DelegateOption(*data) for data in [
            ("fontSize", translate("Delegates", "Fontsize"), "int", 8),
            ("showMajorAncestors",
             translate(
                 "Delegates",
                 "Mention major parent containers which are not in the tree."),
             "bool", False),
            ("showAllAncestors",
             translate(
                 "Delegates",
                 "Mention all parent containers which are not in the tree."),
             "bool", False),
            ("showType", translate("Delegates", "Display element type"),
             "bool", False),
            ("showPositions",
             translate("Delegates", "Display position numbers"), "bool", True),
            ("showPaths", translate("Delegates", "Display paths"), "bool",
             False),
            ("showFlagIcons", translate("Delegates", "Display flag icons"),
             "bool", True),
            ("removeParentFlags",
             translate("Delegates",
                       "Remove flags which appear in ancestor elements"),
             "bool", True),
            ("fitInTitleRowData",
             translate(
                 "Delegates",
                 "This datapiece will be displayed next to the title if it fits"
             ), "datapiece", None),
            ("appendRemainingTags",
             translate("Delegates",
                       "Append all tags that are not listed above"), "bool",
             False),
            #("hideParentFlags",translate("Delegates","Hide flags that appear in parent elements"),"bool",True),
            #("maxRowsTag",translate("Delegates","Maximal number of rows per tag"),"int",4),
            #("maxRowsElement",translate("Delegates","Maximal number of rows per element"),"int",50),
            ("coverSize", translate("Delegates", "Size of covers"), "int", 40)
        ]
    ]

    # This type is useful to create profiles which are not configurable
    defaultProfileType = ProfileType(name='default',
                                     title=translate('Delegates', 'Standard'),
                                     options=collections.OrderedDict([
                                         (option.name, option)
                                         for option in defaultOptions
                                     ]),
                                     leftData=[],
                                     rightData=[])