Beispiel #1
0
class AuthDialog(QDialog):
    """Authorisation dialog"""

    def __init__(self, app):
        """Init dialog and setup ui

        Keyword Arguments:
        app - QApplication

        Returns: None
        """
        QDialog.__init__(self)
        self.ui = AuthDialogUi()
        self.ui.setupUi(self)
        self.setWindowIcon(app.icon)
        self.setWindowTitle('everpad')
        self.app = app

    def accept(self, *args, **kwargs):
        """Save settings"""
        login = self.ui.login.text()
        self.app.settings.set_string('/apps/everpad/login', login)
        keyring.set_password('everpad', login, self.ui.password.text())
        self.hide()

    def reject(self, *args, **kwargs):
        """Hide settings window"""
        self.hide()

    def closeEvent(self, event):
        """Only hide, not close app"""
        self.hide()
        event.ignore()
Beispiel #2
0
    def __init__(self, app):
        """Init dialog and setup ui

        Keyword Arguments:
        app - QApplication

        Returns: None
        """
        QDialog.__init__(self)
        self.ui = AuthDialogUi()
        self.ui.setupUi(self)
        self.setWindowIcon(app.icon)
        self.setWindowTitle('everpad')
        self.app = app