diff options
author | kali <kali@leap.se> | 2012-08-08 09:00:02 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2012-08-08 09:00:02 +0900 |
commit | 01561795251a4eb2255548da22036660cfbf1dda (patch) | |
tree | 285d105ec659a2c18f0d544ca9d624283239ed44 /src/leap/baseapp/dialogs.py | |
parent | 359adbca9dbde07f4054c775650adcd20823f29c (diff) | |
parent | c217bd1f1456cf10ceabf698ea6f4dd8f636f454 (diff) |
Merge branch 'ovpn-invocation' into tests-cleanup
Conflicts:
.gitignore
Diffstat (limited to 'src/leap/baseapp/dialogs.py')
-rw-r--r-- | src/leap/baseapp/dialogs.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/leap/baseapp/dialogs.py b/src/leap/baseapp/dialogs.py new file mode 100644 index 00000000..4b1b5b62 --- /dev/null +++ b/src/leap/baseapp/dialogs.py @@ -0,0 +1,33 @@ +from PyQt4.QtGui import (QDialog, QFrame, QPushButton, QLabel, QMessageBox) + + +class ErrorDialog(QDialog): + def __init__(self, parent=None): + super(ErrorDialog, self).__init__(parent) + + frameStyle = QFrame.Sunken | QFrame.Panel + self.warningLabel = QLabel() + self.warningLabel.setFrameStyle(frameStyle) + self.warningButton = QPushButton("QMessageBox.&warning()") + + def warningMessage(self, msg, label): + msgBox = QMessageBox(QMessageBox.Warning, + "QMessageBox.warning()", msg, + QMessageBox.NoButton, self) + msgBox.addButton("&Ok", QMessageBox.AcceptRole) + msgBox.addButton("&Cancel", QMessageBox.RejectRole) + if msgBox.exec_() == QMessageBox.AcceptRole: + self.warningLabel.setText("Save Again") + else: + self.warningLabel.setText("Continue") + + def criticalMessage(self, msg, label): + msgBox = QMessageBox(QMessageBox.Critical, + "QMessageBox.critical()", msg, + QMessageBox.NoButton, self) + msgBox.addButton("&Ok", QMessageBox.AcceptRole) + msgBox.addButton("&Cancel", QMessageBox.RejectRole) + if msgBox.exec_() == QMessageBox.AcceptRole: + self.warningLabel.setText("Save Again") + else: + self.warningLabel.setText("Continue") |