Exemple #1
1
 def getErrorDialog(self,text,infoText,detailedText):
     dlg = QMessageBox(self)
     dlg.setIcon(QMessageBox.Warning)
     dlg.setWindowModality(QtCore.Qt.WindowModal)
     dlg.setWindowTitle("Error")
     dlg.setText(text)
     dlg.setInformativeText(infoText)
     dlg.setDetailedText(detailedText)
     dlg.setStandardButtons(QMessageBox.Ok)
     
     return dlg
Exemple #2
0
 def install(self):
     pref = self.app.preferences.ui
     ct = pref.configTable
     curi = int(pref.filtersComboBox_new.currentIndex())
     filter = self._filters[self._keys[curi]]
     config, hash = {}, gen_hash()
     settings = self.filter_settings(filter.id, hash)
     for i in range(ct.rowCount()):
         config[unicode(ct.item(i,0).text())] = unicode(ct.item(i,1).text())
     try:
         filter.install(settings, config)
     except Exception as e:
         msg = QMessageBox(pref)
         msg.setIcon(QMessageBox.Critical)
         msg.setWindowTitle("Installation Error ...")
         msg.setText("An Error occured during installation.")
         msg.setInformativeText("Could install filter '%s'." % filter.name)
         msg.setStandardButtons(QMessageBox.Ok)
         msg.setDetailedText(format_exc())
         msg.exec_()
         return
     # success
     self.add_filter_instance(filter, hash)
     pref.filtersComboBox_new.currentIndexChanged.emit(curi)
     pref.filtertabWidget.setCurrentIndex(0)
Exemple #3
0
def QuestionDialog(title, text, info = None, dontAsk = False):
    msgBox = QMessageBox()

    buttonYes = msgBox.addButton(_("Yes"), QMessageBox.ActionRole)
    buttonNo = msgBox.addButton(_("No"), QMessageBox.ActionRole)

    answers = {buttonYes:"yes",
               buttonNo :"no"}
    if dontAsk:
        buttonDontAsk = msgBox.addButton(_("Don't ask again"), QMessageBox.ActionRole)
        answers[buttonDontAsk] = "dontask"

    msgBox.setText(text)
    if not info:
        info = _("Do you want to continue?")
    msgBox.setInformativeText(info)

    dialog = Dialog(_(title), msgBox, closeButton = False, isDialog = True, icon="question")
    dialog.resize(300,120)
    dialog.exec_()

    ctx.mainScreen.processEvents()
    if msgBox.clickedButton() in answers.keys():
        return answers[msgBox.clickedButton()]
    return "no"
Exemple #4
0
def QuestionDialog(title, text, info=None, dontAsk=False):
    msgBox = QMessageBox()

    buttonYes = msgBox.addButton(_("Yes"), QMessageBox.ActionRole)
    buttonNo = msgBox.addButton(_("No"), QMessageBox.ActionRole)

    answers = {buttonYes: "yes", buttonNo: "no"}
    if dontAsk:
        buttonDontAsk = msgBox.addButton(_("Don't ask again"),
                                         QMessageBox.ActionRole)
        answers[buttonDontAsk] = "dontask"

    msgBox.setText(text)
    if not info:
        info = _("Do you want to continue?")
    msgBox.setInformativeText(info)

    dialog = Dialog(_(title),
                    msgBox,
                    closeButton=False,
                    isDialog=True,
                    icon="question")
    dialog.resize(300, 120)
    dialog.exec_()

    ctx.mainScreen.processEvents()
    if msgBox.clickedButton() in answers.keys():
        return answers[msgBox.clickedButton()]
    return "no"
 def show_popup(set_text, detailed, window_title, message_type):
     mess = QMessageBox()
     mess.setText(set_text)
     if len(detailed) > 0:
         mess.setInformativeText("For more information click \"Show Details\"")
     mess.setDetailedText(detailed)
     mess.setIcon(message_type)
     mess.setWindowTitle(window_title)
     mess.setMinimumWidth(500)
     mess.exec_()
    def handleInfo(self):
            msg = QMessageBox()
            #msg.setFixedSize(500, 300)
            #msg.setGeometry(100,100, 400, 200)
            msg.setIcon(QMessageBox.Information)
            msg.setText("Axel Schneider")
            msg.setInformativeText(unicode(u"©2016"))
            msg.setWindowTitle("Cut Video")
            msg.setDetailedText("Python Qt4")
            msg.setStandardButtons(QMessageBox.Ok)
	
            retval = msg.exec_()
            print "value of pressed message box button:", retval
 def checkSaveState(self):
     close = False
     if self._unsavedChanges:
         msgBox = QMessageBox()
         msgBox.setText("A list or setting has been changed.")
         msgBox.setInformativeText("Do you want to save your changes?")
         msgBox.setStandardButtons(QMessageBox.Save | QMessageBox.Discard | QMessageBox.Cancel)
         msgBox.setDefaultButton(QMessageBox.Save)
         ret = msgBox.exec_()
         if ret == QMessageBox.Save:
             self.saveState()
             close = True
         elif ret == QMessageBox.Discard:
             close = True
         elif ret == QMessageBox.Cancel:
             close = False
         else:
             close = False
     else:
         close = True
     return close