Esempio n. 1
0
def infoDialog(parent,
               text,
               title="",
               detailedText=None,
               standardButtons=QtGui.QMessageBox.Ok,
               defaultButton=QtGui.QMessageBox.NoButton):
    return __newMessageBox(parent, title, text, detailedText, standardButtons,
                           defaultButton, QtGui.QPixmap(icons.ICON_INFO_LRG))
Esempio n. 2
0
def warningDialog(parent,
                  text,
                  title="Warning",
                  detailedText=None,
                  standardButtons=QtGui.QMessageBox.Ok,
                  defaultButton=QtGui.QMessageBox.NoButton):
    return __newMessageBox(parent, title, text, detailedText,
                           standardButtons, defaultButton,
                           QtGui.QPixmap(icons.ICON_WARNING_LRG))
Esempio n. 3
0
def questionDialog(parent,
                   text,
                   title="",
                   detailedText=None,
                   standardButtons=QtGui.QMessageBox.Yes
                   | QtGui.QMessageBox.No,
                   defaultButton=QtGui.QMessageBox.No):
    return __newMessageBox(parent, title, text, detailedText,
                           standardButtons, defaultButton,
                           QtGui.QPixmap(icons.ICON_QUESTION_LRG))
Esempio n. 4
0
def exceptionDialog(parent,
                    exc_info,
                    text="",
                    title="Uncaught Exception",
                    standardButtons=QtGui.QMessageBox.Ok,
                    defaultButton=QtGui.QMessageBox.NoButton):
    if not text:
        text = "An error occurred. %s: %s" % (exc_info[0].__name__,
                                              exc_info[1])
    msgBox = __newMessageBox(parent, title, text, None,
                             standardButtons, defaultButton,
                             QtGui.QPixmap(icons.ICON_ERROR_LRG))
    # put exception stack trace as detailed text
    msgBox.setDetailedText("".join(traceback.format_exception(*exc_info)))
    return msgBox