Exemplo n.º 1
0
class Library(QDialog):
    def __init__(self, db_p, db_t, db_a, db_alb, parent):
        super().__init__(parent)
        self.mainwin = parent
        self.ui = Ui_LibForm()
        self.ui.setupUi(self)
        self.hook_buttons()
        self.db_p = db_p
        self.db_alb = db_alb

        self.model = None
        self.show_tree()
        self.ui.Tree.header().hide()

    def hook_buttons(self):
        self.ui.Cancel.pressed.connect(self.close)
        self.ui.Ok.pressed.connect(self.do_scan)

    def do_scan(self):
        self.db_p.set_paths(self.model.checked)
        self.close()
        self.mainwin.scanner.scan(self.model.checked)

    def show_tree(self):
        self.model = MyQDirModel(self.ui.Tree, self.db_p.get_paths())
        self.ui.Tree.setModel(self.model)
        self.ui.Tree.setItemDelegate(MyDelegate())

        self.ui.Tree.setColumnHidden(1, True)
        self.ui.Tree.setColumnHidden(2, True)
        self.ui.Tree.setColumnHidden(3, True)
        self.ui.Tree.expandToDepth(0)
Exemplo n.º 2
0
class Library(QDialog):
    def __init__(self, db_p, db_t, db_a, db_alb, parent):
        super().__init__(parent)
        self.mainwin = parent
        self.ui = Ui_LibForm()
        self.ui.setupUi(self)
        self.hook_buttons()
        self.db_p = db_p
        self.db_alb = db_alb

        self.model = None
        self.show_tree()
        self.ui.Tree.header().hide()

    def hook_buttons(self):
        self.ui.Cancel.pressed.connect(self.close)
        self.ui.Ok.pressed.connect(self.do_scan)

    def do_scan(self):
        self.db_p.set_paths(self.model.checked)
        self.close()
        self.mainwin.scanner.scan(self.model.checked)

    def show_tree(self):
        self.model = MyQDirModel(self.ui.Tree, self.db_p.get_paths())
        self.ui.Tree.setModel(self.model)
        self.ui.Tree.setItemDelegate(MyDelegate())

        self.ui.Tree.setColumnHidden(1, True)
        self.ui.Tree.setColumnHidden(2, True)
        self.ui.Tree.setColumnHidden(3, True)
        self.ui.Tree.expandToDepth(0)
Exemplo n.º 3
0
    def __init__(self, db_p, db_t, db_a, db_alb, parent):
        super().__init__(parent)
        self.mainwin = parent
        self.ui = Ui_LibForm()
        self.ui.setupUi(self)
        self.hook_buttons()
        self.db_p = db_p
        self.db_alb = db_alb

        self.model = None
        self.show_tree()
        self.ui.Tree.header().hide()
Exemplo n.º 4
0
    def __init__(self, db_p, db_t, db_a, db_alb, parent):
        super().__init__(parent)
        self.mainwin = parent
        self.ui = Ui_LibForm()
        self.ui.setupUi(self)
        self.hook_buttons()
        self.db_p = db_p
        self.db_alb = db_alb

        self.model = None
        self.show_tree()
        self.ui.Tree.header().hide()