Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py

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

eric ide

mercurial