Plugins/WizardPlugins/E5MessageBoxWizard/E5MessageBoxWizardDialog.py

Fri, 11 Mar 2011 16:51:57 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 11 Mar 2011 16:51:57 +0100
changeset 945
8cd4d08fa9f6
parent 564
b3d966393ba9
child 1131
7781e396c903
permissions
-rw-r--r--

Made code mostly PEP 8 compliant (except all whitespace and line length).

562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
3 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 Module implementing the eric5 message box wizard dialog.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 import os
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9 from PyQt4.QtCore import pyqtSlot
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
10 from PyQt4.QtGui import QDialog, QDialogButtonBox, QAbstractButton
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
11
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12 from E5Gui import E5MessageBox
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
13
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
14 from .Ui_E5MessageBoxWizardDialog import Ui_E5MessageBoxWizardDialog
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
16
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 class E5MessageBoxWizardDialog(QDialog, Ui_E5MessageBoxWizardDialog):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19 Class implementing the eric5 message box wizard dialog.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 It displays a dialog for entering the parameters
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 for the E5MessageBox code generator.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 """
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
24 def __init__(self, parent=None):
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 Constructor
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28 @param parent reference to the parent widget (QWidget)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 QDialog.__init__(self, parent)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
31 self.setupUi(self)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33 # keep the following three lists in sync
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 self.buttonsList = [
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
35 self.trUtf8("No button"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
36 self.trUtf8("Abort"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
37 self.trUtf8("Apply"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
38 self.trUtf8("Cancel"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
39 self.trUtf8("Close"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
40 self.trUtf8("Discard"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
41 self.trUtf8("Help"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
42 self.trUtf8("Ignore"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
43 self.trUtf8("No"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
44 self.trUtf8("No to all"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
45 self.trUtf8("Ok"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
46 self.trUtf8("Open"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
47 self.trUtf8("Reset"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
48 self.trUtf8("Restore defaults"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
49 self.trUtf8("Retry"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
50 self.trUtf8("Save"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
51 self.trUtf8("Save all"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
52 self.trUtf8("Yes"),
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
53 self.trUtf8("Yes to all"),
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
54 ]
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
55 self.buttonsCodeListBinary = [
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
56 E5MessageBox.NoButton,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
57 E5MessageBox.Abort,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
58 E5MessageBox.Apply,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
59 E5MessageBox.Cancel,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
60 E5MessageBox.Close,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 E5MessageBox.Discard,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
62 E5MessageBox.Help,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 E5MessageBox.Ignore,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64 E5MessageBox.No,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 E5MessageBox.NoToAll,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 E5MessageBox.Ok,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 E5MessageBox.Open,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 E5MessageBox.Reset,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
69 E5MessageBox.RestoreDefaults,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70 E5MessageBox.Retry,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 E5MessageBox.Save,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
72 E5MessageBox.SaveAll,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
73 E5MessageBox.Yes,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
74 E5MessageBox.YesToAll,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
75 ]
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
76 self.buttonsCodeListText = [
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
77 "E5MessageBox.NoButton",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
78 "E5MessageBox.Abort",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
79 "E5MessageBox.Apply",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
80 "E5MessageBox.Cancel",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 "E5MessageBox.Close",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82 "E5MessageBox.Discard",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 "E5MessageBox.Help",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
84 "E5MessageBox.Ignore",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
85 "E5MessageBox.No",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 "E5MessageBox.NoToAll",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
87 "E5MessageBox.Ok",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
88 "E5MessageBox.Open",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89 "E5MessageBox.Reset",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 "E5MessageBox.RestoreDefaults",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
91 "E5MessageBox.Retry",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
92 "E5MessageBox.Save",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 "E5MessageBox.SaveAll",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
94 "E5MessageBox.Yes",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95 "E5MessageBox.YesToAll",
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 ]
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
97
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
98 self.defaultCombo.addItems(self.buttonsList)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
100 self.bTest = \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
101 self.buttonBox.addButton(self.trUtf8("Test"), QDialogButtonBox.ActionRole)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 self.__enabledGroups()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
104
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
105 def __enabledGroups(self):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
107 Private method to enable/disable some group boxes.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
108 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109 self.standardButtons.setEnabled(
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
110 self.rInformation.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
111 self.rQuestion.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
112 self.rWarning.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
113 self.rCritical.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
114 self.rStandard.isChecked()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
115 )
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
116
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
117 self.defaultButton.setEnabled(
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
118 self.rInformation.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119 self.rQuestion.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
120 self.rWarning.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
121 self.rCritical.isChecked()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
122 )
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
123
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
124 self.iconBox.setEnabled(
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
125 self.rYesNo.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
126 self.rRetryAbort.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
127 self.rStandard.isChecked()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
128 )
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
129
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
130 self.bTest.setEnabled(not self.rStandard.isChecked())
564
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 562
diff changeset
131
b3d966393ba9 Did some code cleanup.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 562
diff changeset
132 self.eMessage.setEnabled(not self.rAboutQt.isChecked())
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
133
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 @pyqtSlot(bool)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 def on_rInformation_toggled(self, checked):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 Private slot to handle the toggled signal of the rInformation radio button.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 @param on toggle state (boolean) (ignored)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
141 self.__enabledGroups()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
142
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
143 @pyqtSlot(bool)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
144 def on_rQuestion_toggled(self, checked):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
145 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
146 Private slot to handle the toggled signal of the rQuestion radio button.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
147
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
148 @param on toggle state (boolean) (ignored)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
149 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
150 self.__enabledGroups()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
151
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
152 @pyqtSlot(bool)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
153 def on_rWarning_toggled(self, checked):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
154 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
155 Private slot to handle the toggled signal of the rWarning radio button.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
156
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
157 @param on toggle state (boolean) (ignored)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
158 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
159 self.__enabledGroups()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
160
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
161 @pyqtSlot(bool)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
162 def on_rCritical_toggled(self, checked):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
164 Private slot to handle the toggled signal of the rCritical radio button.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
166 @param on toggle state (boolean) (ignored)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
167 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 self.__enabledGroups()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
169
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
170 @pyqtSlot(bool)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
171 def on_rYesNo_toggled(self, checked):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
173 Private slot to handle the toggled signal of the rYesNo radio button.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
174
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 @param on toggle state (boolean) (ignored)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
176 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 self.__enabledGroups()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
178
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 @pyqtSlot(bool)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
180 def on_rRetryAbort_toggled(self, checked):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
181 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 Private slot to handle the toggled signal of the rRetryAbort radio button.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
183
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 @param on toggle state (boolean) (ignored)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
185 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 self.__enabledGroups()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
187
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
188 @pyqtSlot(bool)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
189 def on_rOkToClearData_toggled(self, checked):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
190 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
191 Private slot to handle the toggled signal of the rOkToClearData radio button.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
192
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
193 @param on toggle state (boolean) (ignored)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
194 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
195 self.__enabledGroups()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 @pyqtSlot(bool)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 def on_rAbout_toggled(self, checked):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200 Private slot to handle the toggled signal of the rAbout radio button.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 @param on toggle state (boolean) (ignored)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
204 self.__enabledGroups()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
205
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
206 @pyqtSlot(bool)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
207 def on_rAboutQt_toggled(self, checked):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
208 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
209 Private slot to handle the toggled signal of the rAboutQt radio button.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
210
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
211 @param on toggle state (boolean) (ignored)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
212 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
213 self.__enabledGroups()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
214
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
215 @pyqtSlot(bool)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
216 def on_rStandard_toggled(self, checked):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
217 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
218 Private slot to handle the toggled signal of the rStandard radio button.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
219
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
220 @param on toggle state (boolean) (ignored)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
221 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
222 self.__enabledGroups()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
223
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
224 @pyqtSlot(QAbstractButton)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
225 def on_buttonBox_clicked(self, button):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
226 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
227 Private slot called by a button of the button box clicked.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
228
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
229 @param button button that was clicked (QAbstractButton)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
230 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
231 if button == self.bTest:
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
232 self.on_bTest_clicked()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
233
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
234 @pyqtSlot()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
235 def on_bTest_clicked(self):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
236 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
237 Private method to test the selected options.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
238 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
239 if self.rAbout.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
240 E5MessageBox.about(None,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
241 self.eCaption.text(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
242 self.eMessage.toPlainText()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
243 )
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
244 elif self.rAboutQt.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
245 E5MessageBox.aboutQt(None,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
246 self.eCaption.text()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
247 )
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
248 elif self.rInformation.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
249 self.rQuestion.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
250 self.rWarning.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
251 self.rCritical.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
252 buttons = E5MessageBox.NoButton
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
253 if self.abortCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
254 buttons |= E5MessageBox.Abort
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
255 if self.applyCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
256 buttons |= E5MessageBox.Apply
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
257 if self.cancelCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
258 buttons |= E5MessageBox.Cancel
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
259 if self.closeCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
260 buttons |= E5MessageBox.Close
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
261 if self.discardCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
262 buttons |= E5MessageBox.Discard
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
263 if self.helpCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
264 buttons |= E5MessageBox.Help
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
265 if self.ignoreCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
266 buttons |= E5MessageBox.Ignore
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
267 if self.noCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
268 buttons |= E5MessageBox.No
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
269 if self.notoallCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
270 buttons |= E5MessageBox.NoToAll
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
271 if self.okCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
272 buttons |= E5MessageBox.Ok
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
273 if self.openCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
274 buttons |= E5MessageBox.Open
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
275 if self.resetCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
276 buttons |= E5MessageBox.Reset
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
277 if self.restoreCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
278 buttons |= E5MessageBox.RestoreDefaults
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
279 if self.retryCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
280 buttons |= E5MessageBox.Retry
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
281 if self.saveCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
282 buttons |= E5MessageBox.Save
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
283 if self.saveallCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
284 buttons |= E5MessageBox.SaveAll
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
285 if self.yesCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
286 buttons |= E5MessageBox.Yes
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
287 if self.yestoallCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
288 buttons |= E5MessageBox.YesToAll
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
289 if buttons == E5MessageBox.NoButton:
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
290 buttons = E5MessageBox.Ok
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
291
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
292 defaultButton = self.buttonsCodeListBinary[self.defaultCombo.currentIndex()]
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
293
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
294 if self.rInformation.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
295 E5MessageBox.information(self,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
296 self.eCaption.text(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
297 self.eMessage.toPlainText(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
298 E5MessageBox.StandardButtons(buttons),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
299 defaultButton
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
300 )
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
301 elif self.rQuestion.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
302 E5MessageBox.question(self,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
303 self.eCaption.text(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
304 self.eMessage.toPlainText(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
305 E5MessageBox.StandardButtons(buttons),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
306 defaultButton
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
307 )
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
308 elif self.rWarning.isChecked():
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
309 E5MessageBox.warning(self,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
310 self.eCaption.text(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
311 self.eMessage.toPlainText(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
312 E5MessageBox.StandardButtons(buttons),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
313 defaultButton
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
314 )
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
315 elif self.rCritical.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
316 E5MessageBox.critical(self,
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
317 self.eCaption.text(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
318 self.eMessage.toPlainText(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
319 E5MessageBox.StandardButtons(buttons),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
320 defaultButton
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
321 )
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
322 elif self.rYesNo.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
323 self.rRetryAbort.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
324 if self.iconInformation.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
325 icon = E5MessageBox.Information
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
326 elif self.iconQuestion.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
327 icon = E5MessageBox.Question
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
328 elif self.iconWarning.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
329 icon = E5MessageBox.Warning
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
330 elif self.iconCritical.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
331 icon = E5MessageBox.Critical
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
332
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
333 if self.rYesNo.isChecked():
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
334 E5MessageBox.yesNo(self,
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
335 self.eCaption.text(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
336 self.eMessage.toPlainText(),
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
337 icon=icon,
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
338 yesDefault=self.yesDefaultCheck.isChecked()
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
339 )
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
340 elif self.rRetryAbort.isChecked():
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
341 E5MessageBox.retryAbort(self,
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
342 self.eCaption.text(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
343 self.eMessage.toPlainText(),
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
344 icon=icon
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
345 )
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
346 elif self.rOkToClearData.isChecked():
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
347 E5MessageBox.okToClearData(self,
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
348 self.eCaption.text(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
349 self.eMessage.toPlainText(),
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
350 lambda: True
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
351 )
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
352
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
353 def __getStandardButtonCode(self, istring, indString, withIntro=True):
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
354 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
355 Private method to generate the button code for the standard buttons.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
356
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
357 @param istring indentation string (string)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
358 @param indString string used for indentation (space or tab) (string)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
359 @keyparam withIntro flag indicating to generate a first line
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
360 with introductory text (boolean)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
361 @return the button code (string)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
362 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
363 buttons = []
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
364 if self.abortCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
365 buttons.append("E5MessageBox.Abort")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
366 if self.applyCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
367 buttons.append("E5MessageBox.Apply")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
368 if self.cancelCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
369 buttons.append("E5MessageBox.Cancel")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
370 if self.closeCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
371 buttons.append("E5MessageBox.Close")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
372 if self.discardCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
373 buttons.append("E5MessageBox.Discard")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
374 if self.helpCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
375 buttons.append("E5MessageBox.Help")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
376 if self.ignoreCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
377 buttons.append("E5MessageBox.Ignore")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
378 if self.noCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
379 buttons.append("E5MessageBox.No")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
380 if self.notoallCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
381 buttons.append("E5MessageBox.NoToAll")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
382 if self.okCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
383 buttons.append("E5MessageBox.Ok")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
384 if self.openCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
385 buttons.append("E5MessageBox.Open")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
386 if self.resetCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
387 buttons.append("E5MessageBox.Reset")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
388 if self.restoreCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
389 buttons.append("E5MessageBox.RestoreDefaults")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
390 if self.retryCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
391 buttons.append("E5MessageBox.Retry")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
392 if self.saveCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
393 buttons.append("E5MessageBox.Save")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
394 if self.saveallCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
395 buttons.append("E5MessageBox.SaveAll")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
396 if self.yesCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
397 buttons.append("E5MessageBox.Yes")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
398 if self.yestoallCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
399 buttons.append("E5MessageBox.YesToAll")
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
400 if len(buttons) == 0:
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
401 return ""
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
402
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
403 istring2 = istring + indString
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
404 joinstring = ' | \\{0}{1}'.format(os.linesep, istring2)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
405 if withIntro:
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
406 btnCode = ',{0}{1}E5MessageBox.StandardButtons('.format(os.linesep, istring)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
407 else:
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
408 btnCode = 'E5MessageBox.StandardButtons('.format(os.linesep, istring)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
409 btnCode += '{0}{1}{2})'.format(os.linesep, istring2, joinstring.join(buttons))
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
410
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
411 return btnCode
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
412
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
413 def __getDefaultButtonCode(self, istring):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
414 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
415 Private method to generate the button code for the default button.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
416
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
417 @param istring indentation string (string)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
418 @param indString string used for indentation (space or tab) (string)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
419 @return the button code (string)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
420 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
421 btnCode = ""
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
422 defaultIndex = self.defaultCombo.currentIndex()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
423 if defaultIndex:
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
424 btnCode = ',{0}{1}{2}'.format(os.linesep, istring,
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
425 self.buttonsCodeListText[defaultIndex])
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
426 return btnCode
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
427
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
428 def getCode(self, indLevel, indString):
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
429 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
430 Public method to get the source code.
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
431
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
432 @param indLevel indentation level (int)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
433 @param indString string used for indentation (space or tab) (string)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
434 @return generated code (string)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
435 """
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
436 # calculate our indentation level and the indentation string
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
437 il = indLevel + 1
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
438 istring = il * indString
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
439 estring = os.linesep + indLevel * indString
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
440
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
441 # now generate the code
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
442 if self.parentSelf.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
443 parent = "self"
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
444 elif self.parentNone.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
445 parent = "None"
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
446 elif self.parentOther.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
447 parent = self.parentEdit.text()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
448 if parent == "":
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
449 parent = "None"
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
450
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
451 if self.iconInformation.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
452 icon = "E5MessageBox.Information"
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
453 elif self.iconQuestion.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
454 icon = "E5MessageBox.Question"
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
455 elif self.iconWarning.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
456 icon = "E5MessageBox.Warning"
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
457 elif self.iconCritical.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
458 icon = "E5MessageBox.Critical"
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
459
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
460 if not self.rStandard.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
461 if self.rAbout.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
462 msgdlg = "E5MessageBox.about({0},{1}".format(parent, os.linesep)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
463 elif self.rAboutQt.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
464 msgdlg = "E5MessageBox.aboutQt({0},{1}".format(parent, os.linesep)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
465 elif self.rInformation.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
466 msgdlg = "res = E5MessageBox.information({0},{1}".format(
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
467 parent, os.linesep)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
468 elif self.rQuestion.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
469 msgdlg = "res = E5MessageBox.question({0},{1}".format(parent, os.linesep)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
470 elif self.rWarning.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
471 msgdlg = "res = E5MessageBox.warning({0},{1}".format(parent, os.linesep)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
472 elif self.rCritical.isChecked():
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
473 msgdlg = "res = E5MessageBox.critical({0},{1}".format(parent, os.linesep)
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
474 elif self.rYesNo.isChecked():
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
475 msgdlg = "res = E5MessageBox.yesNo({0},{1}".format(parent, os.linesep)
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
476 elif self.rRetryAbort.isChecked():
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
477 msgdlg = "res = E5MessageBox.retryAbort({0},{1}".format(parent, os.linesep)
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
478 elif self.rOkToClearData.isChecked():
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
479 msgdlg = "res = E5MessageBox.okToClearData({0},{1}".format(
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
480 parent, os.linesep)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
481
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
482 msgdlg += '{0}self.trUtf8("{1}")'.format(istring, self.eCaption.text())
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
483
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
484 if not self.rAboutQt.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
485 msgdlg += ',{0}{1}self.trUtf8("""{2}""")'.format(
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
486 os.linesep, istring, self.eMessage.toPlainText())
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
487
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
488 if self.rInformation.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
489 self.rQuestion.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
490 self.rWarning.isChecked() or \
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
491 self.rCritical.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
492 msgdlg += self.__getStandardButtonCode(istring, indString)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
493 msgdlg += self.__getDefaultButtonCode(istring)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
494 elif self.rYesNo.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
495 if not self.iconQuestion.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
496 msgdlg += ',{0}{1}icon = {2}'.format(os.linesep, istring, icon)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
497 if self.yesDefaultCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
498 msgdlg += ',{0}{1}yesDefault = True'.format(os.linesep, istring)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
499 elif self.rRetryAbort.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
500 if not self.iconQuestion.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
501 msgdlg += ',{0}{1}icon = {2}'.format(os.linesep, istring, icon)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
502 elif self.rOkToClearData.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
503 saveFunc = self.saveFuncEdit.text()
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
504 if saveFunc == "":
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
505 saveFunc = "lambda: True"
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
506 msgdlg += ',{0}{1}{2}'.format(os.linesep, istring, saveFunc)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
507 else:
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
508 msgdlg = "E5MessageBox.E5MessageBox({0}, {1}".format(icon, os.linesep)
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
509 msgdlg += '{0}self.trUtf8("{1}")'.format(istring, self.eCaption.text())
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
510 msgdlg += ',{0}{1}self.trUtf8("""{2}""")'.format(
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
511 os.linesep, istring, self.eMessage.toPlainText())
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
512 if self.modalCheck.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
513 msgdlg += ',{0}{1}modal = True'.format(os.linesep, istring)
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
514 btnCode = self.__getStandardButtonCode(istring, indString, withIntro=False)
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
515 if btnCode:
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
516 msgdlg += ',{0}{1}buttons = {2}'.format(os.linesep, istring, btnCode)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
517 if not self.parentNone.isChecked():
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
518 msgdlg += ',{0}{1}parent = {2}'.format(os.linesep, istring, parent)
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
519
945
8cd4d08fa9f6 Made code mostly PEP 8 compliant (except all whitespace and line length).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 564
diff changeset
520 msgdlg += '){0}'.format(estring)
562
8bf0dbc1ca6a Added a wizard for the eric5 message box (E5MessageBox).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
521 return msgdlg

eric ide

mercurial