44 self.bookmark1Button.setHidden(True) |
48 self.bookmark1Button.setHidden(True) |
45 self.bookmark1Combo.setHidden(True) |
49 self.bookmark1Combo.setHidden(True) |
46 self.bookmark2Button.setHidden(True) |
50 self.bookmark2Button.setHidden(True) |
47 self.bookmark2Combo.setHidden(True) |
51 self.bookmark2Combo.setHidden(True) |
48 |
52 |
|
53 # connect various radio buttons and input fields |
|
54 self.id1Button.toggled.connect(self.__updateOK) |
|
55 self.id2Button.toggled.connect(self.__updateOK) |
|
56 self.tag1Button.toggled.connect(self.__updateOK) |
|
57 self.tag2Button.toggled.connect(self.__updateOK) |
|
58 self.branch1Button.toggled.connect(self.__updateOK) |
|
59 self.branch2Button.toggled.connect(self.__updateOK) |
|
60 self.bookmark1Button.toggled.connect(self.__updateOK) |
|
61 self.bookmark2Button.toggled.connect(self.__updateOK) |
|
62 self.expression1Button.toggled.connect(self.__updateOK) |
|
63 self.expression2Button.toggled.connect(self.__updateOK) |
|
64 |
|
65 self.id1Edit.textChanged.connect(self.__updateOK) |
|
66 self.id2Edit.textChanged.connect(self.__updateOK) |
|
67 self.expression1Edit.textChanged.connect(self.__updateOK) |
|
68 self.expression2Edit.textChanged.connect(self.__updateOK) |
|
69 |
|
70 self.tag1Combo.editTextChanged.connect(self.__updateOK) |
|
71 self.tag2Combo.editTextChanged.connect(self.__updateOK) |
|
72 self.branch1Combo.editTextChanged.connect(self.__updateOK) |
|
73 self.branch2Combo.editTextChanged.connect(self.__updateOK) |
|
74 self.bookmark1Combo.editTextChanged.connect(self.__updateOK) |
|
75 self.bookmark2Combo.editTextChanged.connect(self.__updateOK) |
|
76 |
49 msh = self.minimumSizeHint() |
77 msh = self.minimumSizeHint() |
50 self.resize(max(self.width(), msh.width()), msh.height()) |
78 self.resize(max(self.width(), msh.width()), msh.height()) |
51 |
79 |
|
80 @pyqtSlot() |
52 def __updateOK(self): |
81 def __updateOK(self): |
53 """ |
82 """ |
54 Private slot to update the OK button. |
83 Private slot to update the OK button. |
55 """ |
84 """ |
56 enabled = True |
85 enabled = True |
57 if self.id1Button.isChecked(): |
86 if self.id1Button.isChecked(): |
58 enabled = enabled and self.id1Edit.text() != "" |
87 enabled = enabled and bool(self.id1Edit.text()) |
59 elif self.tag1Button.isChecked(): |
88 elif self.tag1Button.isChecked(): |
60 enabled = enabled and self.tag1Combo.currentText() != "" |
89 enabled = enabled and bool(self.tag1Combo.currentText()) |
61 elif self.branch1Button.isChecked(): |
90 elif self.branch1Button.isChecked(): |
62 enabled = enabled and self.branch1Combo.currentText() != "" |
91 enabled = enabled and bool(self.branch1Combo.currentText()) |
63 elif self.bookmark1Button.isChecked(): |
92 elif self.bookmark1Button.isChecked(): |
64 enabled = enabled and self.bookmark1Combo.currentText() != "" |
93 enabled = enabled and bool(self.bookmark1Combo.currentText()) |
|
94 elif self.expression1Button.isChecked(): |
|
95 enabled = enabled and bool(self.expression1Edit.text()) |
65 |
96 |
66 if self.id2Button.isChecked(): |
97 if self.id2Button.isChecked(): |
67 enabled = enabled and self.id2Edit.text() != "" |
98 enabled = enabled and bool(self.id2Edit.text()) |
68 elif self.tag2Button.isChecked(): |
99 elif self.tag2Button.isChecked(): |
69 enabled = enabled and self.tag2Combo.currentText() != "" |
100 enabled = enabled and bool(self.tag2Combo.currentText()) |
70 elif self.branch2Button.isChecked(): |
101 elif self.branch2Button.isChecked(): |
71 enabled = enabled and self.branch2Combo.currentText() != "" |
102 enabled = enabled and bool(self.branch2Combo.currentText()) |
72 elif self.bookmark2Button.isChecked(): |
103 elif self.bookmark2Button.isChecked(): |
73 enabled = enabled and self.bookmark2Combo.currentText() != "" |
104 enabled = enabled and bool(self.bookmark2Combo.currentText()) |
|
105 elif self.expression2Button.isChecked(): |
|
106 enabled = enabled and bool(self.expression2Edit.text()) |
74 |
107 |
75 self.buttonBox.button( |
108 self.buttonBox.button( |
76 QDialogButtonBox.StandardButton.Ok).setEnabled(enabled) |
109 QDialogButtonBox.StandardButton.Ok).setEnabled(enabled) |
77 |
|
78 @pyqtSlot(bool) |
|
79 def on_id1Button_toggled(self, checked): |
|
80 """ |
|
81 Private slot to handle changes of the ID1 select button. |
|
82 |
|
83 @param checked state of the button (boolean) |
|
84 """ |
|
85 self.__updateOK() |
|
86 |
|
87 @pyqtSlot(bool) |
|
88 def on_id2Button_toggled(self, checked): |
|
89 """ |
|
90 Private slot to handle changes of the ID2 select button. |
|
91 |
|
92 @param checked state of the button (boolean) |
|
93 """ |
|
94 self.__updateOK() |
|
95 |
|
96 @pyqtSlot(bool) |
|
97 def on_tag1Button_toggled(self, checked): |
|
98 """ |
|
99 Private slot to handle changes of the Tag1 select button. |
|
100 |
|
101 @param checked state of the button (boolean) |
|
102 """ |
|
103 self.__updateOK() |
|
104 |
|
105 @pyqtSlot(bool) |
|
106 def on_tag2Button_toggled(self, checked): |
|
107 """ |
|
108 Private slot to handle changes of the Tag2 select button. |
|
109 |
|
110 @param checked state of the button (boolean) |
|
111 """ |
|
112 self.__updateOK() |
|
113 |
|
114 @pyqtSlot(bool) |
|
115 def on_branch1Button_toggled(self, checked): |
|
116 """ |
|
117 Private slot to handle changes of the Branch1 select button. |
|
118 |
|
119 @param checked state of the button (boolean) |
|
120 """ |
|
121 self.__updateOK() |
|
122 |
|
123 @pyqtSlot(bool) |
|
124 def on_branch2Button_toggled(self, checked): |
|
125 """ |
|
126 Private slot to handle changes of the Branch2 select button. |
|
127 |
|
128 @param checked state of the button (boolean) |
|
129 """ |
|
130 self.__updateOK() |
|
131 |
|
132 @pyqtSlot(bool) |
|
133 def on_bookmark1Button_toggled(self, checked): |
|
134 """ |
|
135 Private slot to handle changes of the Bookmark1 select button. |
|
136 |
|
137 @param checked state of the button (boolean) |
|
138 """ |
|
139 self.__updateOK() |
|
140 |
|
141 @pyqtSlot(bool) |
|
142 def on_bookmark2Button_toggled(self, checked): |
|
143 """ |
|
144 Private slot to handle changes of the Bookmark2 select button. |
|
145 |
|
146 @param checked state of the button (boolean) |
|
147 """ |
|
148 self.__updateOK() |
|
149 |
|
150 @pyqtSlot(str) |
|
151 def on_id1Edit_textChanged(self, txt): |
|
152 """ |
|
153 Private slot to handle changes of the ID1 edit. |
|
154 |
|
155 @param txt text of the edit (string) |
|
156 """ |
|
157 self.__updateOK() |
|
158 |
|
159 @pyqtSlot(str) |
|
160 def on_id2Edit_textChanged(self, txt): |
|
161 """ |
|
162 Private slot to handle changes of the ID2 edit. |
|
163 |
|
164 @param txt text of the edit (string) |
|
165 """ |
|
166 self.__updateOK() |
|
167 |
|
168 @pyqtSlot(str) |
|
169 def on_tag1Combo_editTextChanged(self, txt): |
|
170 """ |
|
171 Private slot to handle changes of the Tag1 combo. |
|
172 |
|
173 @param txt text of the combo (string) |
|
174 """ |
|
175 self.__updateOK() |
|
176 |
|
177 @pyqtSlot(str) |
|
178 def on_tag2Combo_editTextChanged(self, txt): |
|
179 """ |
|
180 Private slot to handle changes of the Tag2 combo. |
|
181 |
|
182 @param txt text of the combo (string) |
|
183 """ |
|
184 self.__updateOK() |
|
185 |
|
186 @pyqtSlot(str) |
|
187 def on_branch1Combo_editTextChanged(self, txt): |
|
188 """ |
|
189 Private slot to handle changes of the Branch1 combo. |
|
190 |
|
191 @param txt text of the combo (string) |
|
192 """ |
|
193 self.__updateOK() |
|
194 |
|
195 @pyqtSlot(str) |
|
196 def on_branch2Combo_editTextChanged(self, txt): |
|
197 """ |
|
198 Private slot to handle changes of the Branch2 combo. |
|
199 |
|
200 @param txt text of the combo (string) |
|
201 """ |
|
202 self.__updateOK() |
|
203 |
|
204 @pyqtSlot(str) |
|
205 def on_bookmark1Combo_editTextChanged(self, txt): |
|
206 """ |
|
207 Private slot to handle changes of the Bookmark1 combo. |
|
208 |
|
209 @param txt text of the combo (string) |
|
210 """ |
|
211 self.__updateOK() |
|
212 |
|
213 @pyqtSlot(str) |
|
214 def on_bookmark2Combo_editTextChanged(self, txt): |
|
215 """ |
|
216 Private slot to handle changes of the Bookmark2 combo. |
|
217 |
|
218 @param txt text of the combo (string) |
|
219 """ |
|
220 self.__updateOK() |
|
221 |
110 |
222 def __getRevision(self, no): |
111 def __getRevision(self, no): |
223 """ |
112 """ |
224 Private method to generate the revision. |
113 Private method to generate the revision. |
225 |
114 |
226 @param no revision number to generate (1 or 2) |
115 @param no revision number to generate (1 or 2) |
227 @return revision (string) |
116 @type int |
|
117 @return revision |
|
118 @rtype str |
228 """ |
119 """ |
229 if no == 1: |
120 if no == 1: |
230 numberButton = self.number1Button |
121 numberButton = self.number1Button |
231 numberSpinBox = self.number1SpinBox |
122 numberSpinBox = self.number1SpinBox |
232 idButton = self.id1Button |
123 idButton = self.id1Button |