summaryrefslogtreecommitdiff
path: root/src/leap/baseapp/dialogs.py
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-08-22 14:10:50 -0400
committerMicah Anderson <micah@riseup.net>2013-08-22 14:10:50 -0400
commit6bae67c3e7c66af9e8ce1605070f7e92f247f0cb (patch)
tree64dc7e2588cc5c17fdb6c801877792f83cfcecf3 /src/leap/baseapp/dialogs.py
parent00efccabb1eb6c3597282bc0e095cf2026f75a3b (diff)
parent00d98a47c60764475d97df1c2eb847e20a77cae5 (diff)
Merge tag '0.3.0' into debian
Tag bitmask version 0.3.0 Conflicts: .coveragerc .tx/config NEWS.rst setup.cfg src/leap/base/checks.py src/leap/base/exceptions.py src/leap/base/tests/test_checks.py src/leap/eip/checks.py src/leap/gui/firstrun/login.py src/leap/gui/locale_rc.py src/leap/util/polkit.py tests/test_qt_environment.py tox.ini
Diffstat (limited to 'src/leap/baseapp/dialogs.py')
-rw-r--r--src/leap/baseapp/dialogs.py61
1 files changed, 0 insertions, 61 deletions
diff --git a/src/leap/baseapp/dialogs.py b/src/leap/baseapp/dialogs.py
deleted file mode 100644
index d256fc99..00000000
--- a/src/leap/baseapp/dialogs.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
-import logging
-
-from PyQt4.QtGui import (QDialog, QFrame, QPushButton, QLabel, QMessageBox)
-
-logger = logging.getLogger(name=__name__)
-
-
-class ErrorDialog(QDialog):
- def __init__(self, parent=None, errtype=None, msg=None, label=None):
- super(ErrorDialog, self).__init__(parent)
- frameStyle = QFrame.Sunken | QFrame.Panel
- self.warningLabel = QLabel()
- self.warningLabel.setFrameStyle(frameStyle)
- self.warningButton = QPushButton("QMessageBox.&warning()")
-
- if msg is not None:
- self.msg = msg
- if label is not None:
- self.label = label
- if errtype == "critical":
- self.criticalMessage(self.msg, self.label)
-
- def warningMessage(self, msg, label):
- msgBox = QMessageBox(QMessageBox.Warning,
- "LEAP Client Error",
- msg,
- QMessageBox.NoButton, self)
- msgBox.addButton("&Ok", QMessageBox.AcceptRole)
- if msgBox.exec_() == QMessageBox.AcceptRole:
- 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,
- "LEAP Client Error",
- msg,
- QMessageBox.NoButton, self)
- msgBox.addButton("&Ok", QMessageBox.AcceptRole)
- msgBox.exec_()
-
- # It's critical, so we exit.
- # We should better emit a signal and connect it
- # with the proper shutdownAndQuit method, but
- # this suffices for now.
- logger.info('Quitting')
- import sys
- sys.exit()
-
- def confirmMessage(self, msg, label, action):
- msgBox = QMessageBox(QMessageBox.Critical,
- self.tr("LEAP Client Error"),
- msg,
- QMessageBox.NoButton, self)
- msgBox.addButton("&Ok", QMessageBox.AcceptRole)
- msgBox.addButton("&Cancel", QMessageBox.RejectRole)
-
- if msgBox.exec_() == QMessageBox.AcceptRole:
- action()