247 def on_bTest_clicked(self): |
247 def on_bTest_clicked(self): |
248 """ |
248 """ |
249 Private method to test the selected options. |
249 Private method to test the selected options. |
250 """ |
250 """ |
251 if self.rAbout.isChecked(): |
251 if self.rAbout.isChecked(): |
252 E5MessageBox.about(None, |
252 E5MessageBox.about( |
|
253 None, |
253 self.eCaption.text(), |
254 self.eCaption.text(), |
254 self.eMessage.toPlainText() |
255 self.eMessage.toPlainText() |
255 ) |
256 ) |
256 elif self.rAboutQt.isChecked(): |
257 elif self.rAboutQt.isChecked(): |
257 E5MessageBox.aboutQt(None, |
258 E5MessageBox.aboutQt( |
258 self.eCaption.text() |
259 None, self.eCaption.text() |
259 ) |
260 ) |
260 elif self.rInformation.isChecked() or \ |
261 elif self.rInformation.isChecked() or \ |
261 self.rQuestion.isChecked() or \ |
262 self.rQuestion.isChecked() or \ |
262 self.rWarning.isChecked() or \ |
263 self.rWarning.isChecked() or \ |
263 self.rCritical.isChecked(): |
264 self.rCritical.isChecked(): |
303 |
304 |
304 defaultButton = self.buttonsCodeListBinary[ |
305 defaultButton = self.buttonsCodeListBinary[ |
305 self.defaultCombo.currentIndex()] |
306 self.defaultCombo.currentIndex()] |
306 |
307 |
307 if self.rInformation.isChecked(): |
308 if self.rInformation.isChecked(): |
308 E5MessageBox.information(self, |
309 E5MessageBox.information( |
|
310 self, |
309 self.eCaption.text(), |
311 self.eCaption.text(), |
310 self.eMessage.toPlainText(), |
312 self.eMessage.toPlainText(), |
311 E5MessageBox.StandardButtons(buttons), |
313 E5MessageBox.StandardButtons(buttons), |
312 defaultButton |
314 defaultButton |
313 ) |
315 ) |
314 elif self.rQuestion.isChecked(): |
316 elif self.rQuestion.isChecked(): |
315 E5MessageBox.question(self, |
317 E5MessageBox.question( |
|
318 self, |
316 self.eCaption.text(), |
319 self.eCaption.text(), |
317 self.eMessage.toPlainText(), |
320 self.eMessage.toPlainText(), |
318 E5MessageBox.StandardButtons(buttons), |
321 E5MessageBox.StandardButtons(buttons), |
319 defaultButton |
322 defaultButton |
320 ) |
323 ) |
321 elif self.rWarning.isChecked(): |
324 elif self.rWarning.isChecked(): |
322 E5MessageBox.warning(self, |
325 E5MessageBox.warning( |
|
326 self, |
323 self.eCaption.text(), |
327 self.eCaption.text(), |
324 self.eMessage.toPlainText(), |
328 self.eMessage.toPlainText(), |
325 E5MessageBox.StandardButtons(buttons), |
329 E5MessageBox.StandardButtons(buttons), |
326 defaultButton |
330 defaultButton |
327 ) |
331 ) |
328 elif self.rCritical.isChecked(): |
332 elif self.rCritical.isChecked(): |
329 E5MessageBox.critical(self, |
333 E5MessageBox.critical( |
|
334 self, |
330 self.eCaption.text(), |
335 self.eCaption.text(), |
331 self.eMessage.toPlainText(), |
336 self.eMessage.toPlainText(), |
332 E5MessageBox.StandardButtons(buttons), |
337 E5MessageBox.StandardButtons(buttons), |
333 defaultButton |
338 defaultButton |
334 ) |
339 ) |
342 icon = E5MessageBox.Warning |
347 icon = E5MessageBox.Warning |
343 elif self.iconCritical.isChecked(): |
348 elif self.iconCritical.isChecked(): |
344 icon = E5MessageBox.Critical |
349 icon = E5MessageBox.Critical |
345 |
350 |
346 if self.rYesNo.isChecked(): |
351 if self.rYesNo.isChecked(): |
347 E5MessageBox.yesNo(self, |
352 E5MessageBox.yesNo( |
|
353 self, |
348 self.eCaption.text(), |
354 self.eCaption.text(), |
349 self.eMessage.toPlainText(), |
355 self.eMessage.toPlainText(), |
350 icon=icon, |
356 icon=icon, |
351 yesDefault=self.yesDefaultCheck.isChecked() |
357 yesDefault=self.yesDefaultCheck.isChecked() |
352 ) |
358 ) |
353 elif self.rRetryAbort.isChecked(): |
359 elif self.rRetryAbort.isChecked(): |
354 E5MessageBox.retryAbort(self, |
360 E5MessageBox.retryAbort( |
|
361 self, |
355 self.eCaption.text(), |
362 self.eCaption.text(), |
356 self.eMessage.toPlainText(), |
363 self.eMessage.toPlainText(), |
357 icon=icon |
364 icon=icon |
358 ) |
365 ) |
359 elif self.rOkToClearData.isChecked(): |
366 elif self.rOkToClearData.isChecked(): |
360 E5MessageBox.okToClearData(self, |
367 E5MessageBox.okToClearData( |
|
368 self, |
361 self.eCaption.text(), |
369 self.eCaption.text(), |
362 self.eMessage.toPlainText(), |
370 self.eMessage.toPlainText(), |
363 lambda: True |
371 lambda: True |
364 ) |
372 ) |
365 |
373 |
434 @return the button code (string) |
442 @return the button code (string) |
435 """ |
443 """ |
436 btnCode = "" |
444 btnCode = "" |
437 defaultIndex = self.defaultCombo.currentIndex() |
445 defaultIndex = self.defaultCombo.currentIndex() |
438 if defaultIndex: |
446 if defaultIndex: |
439 btnCode = ',{0}{1}{2}'.format(os.linesep, istring, |
447 btnCode = ',{0}{1}{2}'.format( |
|
448 os.linesep, istring, |
440 self.buttonsCodeListText[defaultIndex]) |
449 self.buttonsCodeListText[defaultIndex]) |
441 return btnCode |
450 return btnCode |
442 |
451 |
443 def getCode(self, indLevel, indString): |
452 def getCode(self, indLevel, indString): |
444 """ |
453 """ |