Exemple #1
0
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        uic.loadUi(projectpath_join('widgets', 'ui', 'mainwindow.ui'), self)
        # SQL session
        self.session = Session()

        # connections
        self.actionExit.triggered.connect(self.close)
        self.authorsListWidget.itemClicked.connect(self.author_selected)
        self.quotesListWidget.itemClicked.connect(self.quote_selected)
        self.addAuthorPushButton.clicked.connect(self.add_author)
        self.deleteAuthorPushButton.clicked.connect(self.del_author)
        self.addQuotePushButton.clicked.connect(self.add_quote)
        self.deleteQuotePushButton.clicked.connect(self.del_quote)

        # toolbar
        self.actionRefresh.setIcon(QIcon(QPixmap(
            projectpath_join('res/reload.png'))))
        self.actionRefresh.triggered.connect(self.updateAuthorWidget)

        self.splitter.setStretchFactor(1, 0)
        self.splitter.setSizes([250, 500])
        self.updateAuthorWidget()
 def __init__(self, parent=None):
     super(AddAuthorDialog, self).__init__(parent)
     uic.loadUi(projectpath_join('widgets', 'ui', 'addauthordialog.ui'),
                self)