Plugins/WizardPlugins/E5MessageBoxWizard/E5MessageBoxWizardDialog.py

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

eric ide

mercurial