Exemplo n.º 1
0
def __create_collection_panel_context_menu():

    def collection_delete_tracks_func(panel, context, tracks):
        panel.collection.delete_tracks(tracks)

    items = []
    items.append(menu.simple_separator('cp-sep', after=['properties']))
    items.append(menuitems.OpenDirectoryMenuItem('open-directory', after=[items[-1].name]))
    items.append(menuitems.TrashMenuItem('trash-tracks', after=[items[-1].name], delete_tracks_func=collection_delete_tracks_func))

    for item in items:
        item.register('collection-panel-context-menu')
Exemplo n.º 2
0
def __create_files_panel_context_menu():

    def trash_tracks_func(parent, context, tracks):
        menuitems.generic_trash_tracks_func(parent, context, tracks)
        parent.refresh(None)

    items = []
    items.append(menu.simple_separator('fp-sep', after=['properties']))
    items.append(menuitems.OpenDirectoryMenuItem('open-directory', after=[items[-1].name]))
    items.append(menuitems.TrashMenuItem('trash-tracks', after=[items[-1].name], trash_tracks_func=trash_tracks_func))

    for item in items:
        item.register('files-panel-context-menu')