30 super().__init__(parent) |
30 super().__init__(parent) |
31 self.setupUi(self) |
31 self.setupUi(self) |
32 |
32 |
33 # keep the following three lists in sync |
33 # keep the following three lists in sync |
34 self.buttonsList = [ |
34 self.buttonsList = [ |
35 self.trUtf8("No button"), |
35 self.tr("No button"), |
36 self.trUtf8("Abort"), |
36 self.tr("Abort"), |
37 self.trUtf8("Apply"), |
37 self.tr("Apply"), |
38 self.trUtf8("Cancel"), |
38 self.tr("Cancel"), |
39 self.trUtf8("Close"), |
39 self.tr("Close"), |
40 self.trUtf8("Discard"), |
40 self.tr("Discard"), |
41 self.trUtf8("Help"), |
41 self.tr("Help"), |
42 self.trUtf8("Ignore"), |
42 self.tr("Ignore"), |
43 self.trUtf8("No"), |
43 self.tr("No"), |
44 self.trUtf8("No to all"), |
44 self.tr("No to all"), |
45 self.trUtf8("Ok"), |
45 self.tr("Ok"), |
46 self.trUtf8("Open"), |
46 self.tr("Open"), |
47 self.trUtf8("Reset"), |
47 self.tr("Reset"), |
48 self.trUtf8("Restore defaults"), |
48 self.tr("Restore defaults"), |
49 self.trUtf8("Retry"), |
49 self.tr("Retry"), |
50 self.trUtf8("Save"), |
50 self.tr("Save"), |
51 self.trUtf8("Save all"), |
51 self.tr("Save all"), |
52 self.trUtf8("Yes"), |
52 self.tr("Yes"), |
53 self.trUtf8("Yes to all"), |
53 self.tr("Yes to all"), |
54 ] |
54 ] |
55 self.buttonsCodeListBinary = [ |
55 self.buttonsCodeListBinary = [ |
56 E5MessageBox.NoButton, |
56 E5MessageBox.NoButton, |
57 E5MessageBox.Abort, |
57 E5MessageBox.Abort, |
58 E5MessageBox.Apply, |
58 E5MessageBox.Apply, |
96 ] |
96 ] |
97 |
97 |
98 self.defaultCombo.addItems(self.buttonsList) |
98 self.defaultCombo.addItems(self.buttonsList) |
99 |
99 |
100 self.bTest = self.buttonBox.addButton( |
100 self.bTest = self.buttonBox.addButton( |
101 self.trUtf8("Test"), QDialogButtonBox.ActionRole) |
101 self.tr("Test"), QDialogButtonBox.ActionRole) |
102 |
102 |
103 self.__enabledGroups() |
103 self.__enabledGroups() |
104 |
104 |
105 def __enabledGroups(self): |
105 def __enabledGroups(self): |
106 """ |
106 """ |
509 elif self.rOkToClearData.isChecked(): |
509 elif self.rOkToClearData.isChecked(): |
510 msgdlg = "{0} = E5MessageBox.okToClearData({1}".format( |
510 msgdlg = "{0} = E5MessageBox.okToClearData({1}".format( |
511 resvar, os.linesep) |
511 resvar, os.linesep) |
512 |
512 |
513 msgdlg += '{0}{1},{2}'.format(istring, parent, os.linesep) |
513 msgdlg += '{0}{1},{2}'.format(istring, parent, os.linesep) |
514 msgdlg += '{0}self.trUtf8("{1}")'.format( |
514 msgdlg += '{0}self.tr("{1}")'.format( |
515 istring, self.eCaption.text()) |
515 istring, self.eCaption.text()) |
516 |
516 |
517 if not self.rAboutQt.isChecked(): |
517 if not self.rAboutQt.isChecked(): |
518 msgdlg += ',{0}{1}self.trUtf8("""{2}""")'.format( |
518 msgdlg += ',{0}{1}self.tr("""{2}""")'.format( |
519 os.linesep, istring, self.eMessage.toPlainText()) |
519 os.linesep, istring, self.eMessage.toPlainText()) |
520 |
520 |
521 if self.rInformation.isChecked() or \ |
521 if self.rInformation.isChecked() or \ |
522 self.rQuestion.isChecked() or \ |
522 self.rQuestion.isChecked() or \ |
523 self.rWarning.isChecked() or \ |
523 self.rWarning.isChecked() or \ |
546 resvar = "dlg" |
546 resvar = "dlg" |
547 |
547 |
548 msgdlg = "{0} = E5MessageBox.E5MessageBox({1}".format( |
548 msgdlg = "{0} = E5MessageBox.E5MessageBox({1}".format( |
549 resvar, os.linesep) |
549 resvar, os.linesep) |
550 msgdlg += '{0}{1},{2}'.format(istring, icon, os.linesep) |
550 msgdlg += '{0}{1},{2}'.format(istring, icon, os.linesep) |
551 msgdlg += '{0}self.trUtf8("{1}")'.format( |
551 msgdlg += '{0}self.tr("{1}")'.format( |
552 istring, self.eCaption.text()) |
552 istring, self.eCaption.text()) |
553 msgdlg += ',{0}{1}self.trUtf8("""{2}""")'.format( |
553 msgdlg += ',{0}{1}self.tr("""{2}""")'.format( |
554 os.linesep, istring, self.eMessage.toPlainText()) |
554 os.linesep, istring, self.eMessage.toPlainText()) |
555 if self.modalCheck.isChecked(): |
555 if self.modalCheck.isChecked(): |
556 msgdlg += ',{0}{1}modal=True'.format(os.linesep, istring) |
556 msgdlg += ',{0}{1}modal=True'.format(os.linesep, istring) |
557 btnCode = self.__getStandardButtonCode( |
557 btnCode = self.__getStandardButtonCode( |
558 istring, indString, withIntro=False) |
558 istring, indString, withIntro=False) |