示例#1
0
    def __init__(self, parent = None, row=None, files=None, status=False):
        super(ExTags, self).__init__(parent)

        self._status = status

        def set_pmode(v): self.previewMode = v
        
        self.receives = [
            (SELECTIONCHANGED, self.loadFiles),
            ('previewModeChanged', set_pmode)]
        self.emits = ['onetomany']

        super(ExTagsPlugin, self).__init__(parent, row, files, status, False)
        self.setMinimumSize(50,50)

        self.okcancel.ok.hide()
        self.okcancel.cancel.hide()

        self.previewMode = False
        self.canceled = False
        self.filechanged = False

        if files:
            self.loadFiles(files)

        action = QAction('Save Extended', self)
        self.connect(action, SIGNAL('triggered()'), self.save)
        action.setShortcut('Ctrl+Shift+S')

        def sep():
            k = QAction(self)
            k.setSeparator(True)
            return k
        add_shortcuts('&Plugins', [sep(), action, sep()])
示例#2
0
def load_window(parent):
    import puddlestuff.libraries.quodlibetlib as quodlibet
    from puddlestuff.constants import HOMEDIR
    lib = quodlibet.QuodLibet(os.path.join(HOMEDIR, '.quodlibet/songs')
    from Levenshtein import ratio
    algos = [Algo(['artist', 'title'], 0.80, ratio), Algo(['artist', 'title'], 0.70, ratio)]
    qb = parent.addDock('Duplicates', DupeTree, RIGHTDOCK, connect=True)
    qb.loadDupes(lib, algos, ['%artist% - %title%', '%title%'])

def init(parent=None):
    action = QAction('Dupes in Lib', parent)
    #if not status['library']:
        #action.setEnabled(False)
    parent.connect(action, SIGNAL('triggered()'), lambda: load_window(parent))
    add_shortcuts('&Tools', [action])
    

if __name__ == "__main__":
    import puddlestuff.libraries.quodlibetlib as quodlibet
    from puddlestuff.constants import HOMEDIR
    lib = quodlibet.QuodLibet(os.path.join(HOMEDIR, '.quodlibet/songs')
    from Levenshtein import ratio
    algos = [Algo(['artist', 'title'], 0.80, ratio), Algo(['artist', 'title'], 0.70, ratio)]
    app = QApplication(sys.argv)
    qb = DupeTree()
    qb.show()
    QApplication.processEvents()
    qb.loadDupes(lib, algos, ['%artist% - %title%', '%title%'])
    app.exec_()
示例#3
0
def init(parent=None):
    action = QAction('Add 2 seconds to modified time', parent)
    action.connect(action, SIGNAL('triggered()'), lambda: add_seconds(parent))
    action.setShortcut('Ctrl+M')
    
    def sep():
        k = QAction(parent)
        k.setSeparator(True)
        return k
    add_shortcuts('&Plugins', [sep(), action, sep()])
示例#4
0
def init(parent=None):

    def sep():
        k = QAction(parent)
        k.setSeparator(True)
        return k

    action = QAction('Export tags', parent)
    action.connect(action, SIGNAL('triggered()'), export_tags)
    add_shortcuts('&Plugins', [sep(), action, sep()])
示例#5
0
def init(parent=None):
    action = QAction('&Update to ID3v2.4', parent)
    connect_shortcut(action, FILESSELECTED)
    parent.connect(action, SIGNAL('triggered()'), partial(update_to_24, parent))

    convert = QAction('&Convert to UTF-8', parent)
    connect_shortcut(convert, FILESSELECTED)
    parent.connect(convert, SIGNAL('triggered()'), partial(to_utf8, parent))
    
    add_shortcuts('Ta&g Tools', [separator(), action, convert, separator()])
示例#6
0
def init(parent=None):
    state = {}
    
    def sep():
        k = QAction(parent)
        k.setSeparator(True)
        return k

    def show_fields(checked):
        if checked:
            tb = status['table']
            header = tb.horizontalHeader()
            state['headerdata'] = tb.model().headerdata[:]
            state['headerstate'] = header.saveState()
            show_all_fields()
        else:
            restore_view(state)


    action = QAction('Show all fields', parent)
    action.setCheckable(True)
    action.connect(action, SIGNAL('toggled(bool)'), show_fields)
    add_shortcuts('&Plugins', [sep(), action, sep()])
    add_config_widget(Settings)