Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3190
a9a94491c4fd
child 3656
441956d8fce5
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
33 super(MessageBoxWizardDialog, self).__init__(parent) 33 super(MessageBoxWizardDialog, self).__init__(parent)
34 self.setupUi(self) 34 self.setupUi(self)
35 35
36 # keep the following three lists in sync 36 # keep the following three lists in sync
37 self.buttonsList = [ 37 self.buttonsList = [
38 self.trUtf8("No button"), 38 self.tr("No button"),
39 self.trUtf8("Abort"), 39 self.tr("Abort"),
40 self.trUtf8("Apply"), 40 self.tr("Apply"),
41 self.trUtf8("Cancel"), 41 self.tr("Cancel"),
42 self.trUtf8("Close"), 42 self.tr("Close"),
43 self.trUtf8("Discard"), 43 self.tr("Discard"),
44 self.trUtf8("Help"), 44 self.tr("Help"),
45 self.trUtf8("Ignore"), 45 self.tr("Ignore"),
46 self.trUtf8("No"), 46 self.tr("No"),
47 self.trUtf8("No to all"), 47 self.tr("No to all"),
48 self.trUtf8("Ok"), 48 self.tr("Ok"),
49 self.trUtf8("Open"), 49 self.tr("Open"),
50 self.trUtf8("Reset"), 50 self.tr("Reset"),
51 self.trUtf8("Restore defaults"), 51 self.tr("Restore defaults"),
52 self.trUtf8("Retry"), 52 self.tr("Retry"),
53 self.trUtf8("Save"), 53 self.tr("Save"),
54 self.trUtf8("Save all"), 54 self.tr("Save all"),
55 self.trUtf8("Yes"), 55 self.tr("Yes"),
56 self.trUtf8("Yes to all"), 56 self.tr("Yes to all"),
57 ] 57 ]
58 self.buttonsCodeListBinary = [ 58 self.buttonsCodeListBinary = [
59 QMessageBox.NoButton, 59 QMessageBox.NoButton,
60 QMessageBox.Abort, 60 QMessageBox.Abort,
61 QMessageBox.Apply, 61 QMessageBox.Apply,
99 ] 99 ]
100 100
101 self.defaultCombo.addItems(self.buttonsList) 101 self.defaultCombo.addItems(self.buttonsList)
102 102
103 self.bTest = self.buttonBox.addButton( 103 self.bTest = self.buttonBox.addButton(
104 self.trUtf8("Test"), QDialogButtonBox.ActionRole) 104 self.tr("Test"), QDialogButtonBox.ActionRole)
105 105
106 def __testQt42(self): 106 def __testQt42(self):
107 """ 107 """
108 Private method to test the selected options for Qt 4.2.0. 108 Private method to test the selected options for Qt 4.2.0.
109 """ 109 """
340 msgdlg = "{0} = QMessageBox.critical(".format(resvar) 340 msgdlg = "{0} = QMessageBox.critical(".format(resvar)
341 341
342 if self.rAboutQt.isChecked(): 342 if self.rAboutQt.isChecked():
343 if self.eCaption.text(): 343 if self.eCaption.text():
344 msgdlg += '{0}{1}{2}'.format(os.linesep, istring, parent) 344 msgdlg += '{0}{1}{2}'.format(os.linesep, istring, parent)
345 msgdlg += ',{0}{1}self.trUtf8("{2}")'.format( 345 msgdlg += ',{0}{1}self.tr("{2}")'.format(
346 os.linesep, istring, self.eCaption.text()) 346 os.linesep, istring, self.eCaption.text())
347 else: 347 else:
348 msgdlg += parent 348 msgdlg += parent
349 else: 349 else:
350 msgdlg += '{0}{1}{2}'.format(os.linesep, istring, parent) 350 msgdlg += '{0}{1}{2}'.format(os.linesep, istring, parent)
351 msgdlg += ',{0}{1}self.trUtf8("{2}")'.format( 351 msgdlg += ',{0}{1}self.tr("{2}")'.format(
352 os.linesep, istring, self.eCaption.text()) 352 os.linesep, istring, self.eCaption.text())
353 msgdlg += ',{0}{1}self.trUtf8("""{2}""")'.format( 353 msgdlg += ',{0}{1}self.tr("""{2}""")'.format(
354 os.linesep, istring, self.eMessage.toPlainText()) 354 os.linesep, istring, self.eMessage.toPlainText())
355 if not self.rAbout.isChecked() and not self.rAboutQt.isChecked(): 355 if not self.rAbout.isChecked() and not self.rAboutQt.isChecked():
356 msgdlg += self.__getButtonCode(istring, indString) 356 msgdlg += self.__getButtonCode(istring, indString)
357 msgdlg += '){0}'.format(estring) 357 msgdlg += '){0}'.format(estring)
358 return msgdlg 358 return msgdlg

eric ide

mercurial