summaryrefslogtreecommitdiff
path: root/src/leap/baseapp/dialogs.py
diff options
context:
space:
mode:
authorkali <kali@leap.se>2012-09-05 10:23:24 +0900
committerkali <kali@leap.se>2012-09-05 10:23:24 +0900
commitc190b7f66cc1977d0e058bfa2d8fc1a850326320 (patch)
tree2f19a173c5e312c09d4bbe379749d534b7f23199 /src/leap/baseapp/dialogs.py
parent535e584ba978a7a234a52df14f89197fbc3cea14 (diff)
missing_pkexec error converted to "auto" error.
idea is that we define user messages in the exceptions, and queue them during (conductor) checks. user facing dialogs get constucted from exception attrs. if critical, log as such and exit.
Diffstat (limited to 'src/leap/baseapp/dialogs.py')
-rw-r--r--src/leap/baseapp/dialogs.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/leap/baseapp/dialogs.py b/src/leap/baseapp/dialogs.py
index 4b1b5b62..d37a234c 100644
--- a/src/leap/baseapp/dialogs.py
+++ b/src/leap/baseapp/dialogs.py
@@ -4,7 +4,6 @@ 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)
@@ -15,19 +14,17 @@ class ErrorDialog(QDialog):
"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")
+ pass
+ # do whatever we want to do after
+ # closing the dialog. we can pass that
+ # in the constructor
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")
+ msgBox.exec_()
+ import sys
+ sys.exit()