Plugins/WizardPlugins/E5MessageBoxWizard/E5MessageBoxWizardDialog.py

changeset 3124
a01e410893ac
parent 3117
449af5479f49
child 3142
55030c09e142
child 3190
a9a94491c4fd
equal deleted inserted replaced
3123:2c89ff79c246 3124:a01e410893ac
418 buttons.append("E5MessageBox.YesToAll") 418 buttons.append("E5MessageBox.YesToAll")
419 if len(buttons) == 0: 419 if len(buttons) == 0:
420 return "" 420 return ""
421 421
422 istring2 = istring + indString 422 istring2 = istring + indString
423 joinstring = ' | \\{0}{1}'.format(os.linesep, istring2) 423 joinstring = ' |{0}{1}'.format(os.linesep, istring2)
424 if withIntro: 424 if withIntro:
425 btnCode = ',{0}{1}E5MessageBox.StandardButtons('.format( 425 btnCode = ',{0}{1}E5MessageBox.StandardButtons('.format(
426 os.linesep, istring) 426 os.linesep, istring)
427 else: 427 else:
428 btnCode = 'E5MessageBox.StandardButtons('.format( 428 btnCode = 'E5MessageBox.StandardButtons('.format(
478 icon = "E5MessageBox.Warning" 478 icon = "E5MessageBox.Warning"
479 elif self.iconCritical.isChecked(): 479 elif self.iconCritical.isChecked():
480 icon = "E5MessageBox.Critical" 480 icon = "E5MessageBox.Critical"
481 481
482 if not self.rStandard.isChecked(): 482 if not self.rStandard.isChecked():
483 resvar = self.eResultVar.text()
484 if not resvar:
485 resvar = "res"
486
483 if self.rAbout.isChecked(): 487 if self.rAbout.isChecked():
484 msgdlg = "E5MessageBox.about({0}".format(os.linesep) 488 msgdlg = "E5MessageBox.about({0}".format(os.linesep)
485 elif self.rAboutQt.isChecked(): 489 elif self.rAboutQt.isChecked():
486 msgdlg = "E5MessageBox.aboutQt({0}".format(os.linesep) 490 msgdlg = "E5MessageBox.aboutQt({0}".format(os.linesep)
487 elif self.rInformation.isChecked(): 491 elif self.rInformation.isChecked():
488 msgdlg = "res = E5MessageBox.information({0}".format( 492 msgdlg = "{0} = E5MessageBox.information({1}".format(
489 os.linesep) 493 resvar, os.linesep)
490 elif self.rQuestion.isChecked(): 494 elif self.rQuestion.isChecked():
491 msgdlg = "res = E5MessageBox.question({0}".format(os.linesep) 495 msgdlg = "{0} = E5MessageBox.question({1}".format(
496 resvar, os.linesep)
492 elif self.rWarning.isChecked(): 497 elif self.rWarning.isChecked():
493 msgdlg = "res = E5MessageBox.warning({0}".format(os.linesep) 498 msgdlg = "{0} = E5MessageBox.warning({1}".format(
499 resvar, os.linesep)
494 elif self.rCritical.isChecked(): 500 elif self.rCritical.isChecked():
495 msgdlg = "res = E5MessageBox.critical({0}".format(os.linesep) 501 msgdlg = "{0} = E5MessageBox.critical({1}".format(
502 resvar, os.linesep)
496 elif self.rYesNo.isChecked(): 503 elif self.rYesNo.isChecked():
497 msgdlg = "res = E5MessageBox.yesNo({0}".format(os.linesep) 504 msgdlg = "{0} = E5MessageBox.yesNo({1}".format(
505 resvar, os.linesep)
498 elif self.rRetryAbort.isChecked(): 506 elif self.rRetryAbort.isChecked():
499 msgdlg = "res = E5MessageBox.retryAbort({0}".format(os.linesep) 507 msgdlg = "{0} = E5MessageBox.retryAbort({1}".format(
508 resvar, os.linesep)
500 elif self.rOkToClearData.isChecked(): 509 elif self.rOkToClearData.isChecked():
501 msgdlg = "res = E5MessageBox.okToClearData({0}".format( 510 msgdlg = "{0} = E5MessageBox.okToClearData({1}".format(
502 os.linesep) 511 resvar, os.linesep)
503 512
504 msgdlg += '{0}{1},{2}'.format(istring, parent, os.linesep) 513 msgdlg += '{0}{1},{2}'.format(istring, parent, os.linesep)
505 msgdlg += '{0}self.trUtf8("{1}")'.format( 514 msgdlg += '{0}self.trUtf8("{1}")'.format(
506 istring, self.eCaption.text()) 515 istring, self.eCaption.text())
507 516
530 saveFunc = self.saveFuncEdit.text() 539 saveFunc = self.saveFuncEdit.text()
531 if saveFunc == "": 540 if saveFunc == "":
532 saveFunc = "lambda: True" 541 saveFunc = "lambda: True"
533 msgdlg += ',{0}{1}{2}'.format(os.linesep, istring, saveFunc) 542 msgdlg += ',{0}{1}{2}'.format(os.linesep, istring, saveFunc)
534 else: 543 else:
535 msgdlg = "E5MessageBox.E5MessageBox({0}".format(os.linesep) 544 resvar = self.eResultVar.text()
545 if not resvar:
546 resvar = "dlg"
547
548 msgdlg = "{0} = E5MessageBox.E5MessageBox({1}".format(
549 resvar, os.linesep)
536 msgdlg += '{0}{1},{2}'.format(istring, icon, os.linesep) 550 msgdlg += '{0}{1},{2}'.format(istring, icon, os.linesep)
537 msgdlg += '{0}self.trUtf8("{1}")'.format( 551 msgdlg += '{0}self.trUtf8("{1}")'.format(
538 istring, self.eCaption.text()) 552 istring, self.eCaption.text())
539 msgdlg += ',{0}{1}self.trUtf8("""{2}""")'.format( 553 msgdlg += ',{0}{1}self.trUtf8("""{2}""")'.format(
540 os.linesep, istring, self.eMessage.toPlainText()) 554 os.linesep, istring, self.eMessage.toPlainText())

eric ide

mercurial