Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py

changeset 3119
8b19074bb239
parent 2893
150de635fa29
child 3124
a01e410893ac
equal deleted inserted replaced
3118:b1278ba1d7fe 3119:8b19074bb239
282 buttons.append("QMessageBox.YesToAll") 282 buttons.append("QMessageBox.YesToAll")
283 if len(buttons) == 0: 283 if len(buttons) == 0:
284 return "" 284 return ""
285 285
286 istring2 = istring + indString 286 istring2 = istring + indString
287 joinstring = ' | \\{0}{1}'.format(os.linesep, istring2) 287 joinstring = ' |{0}{1}'.format(os.linesep, istring2)
288 btnCode = ',{0}{1}QMessageBox.StandardButtons('.format( 288 btnCode = ',{0}{1}QMessageBox.StandardButtons('.format(
289 os.linesep, istring) 289 os.linesep, istring)
290 btnCode += '{0}{1}{2})'.format( 290 btnCode += '{0}{1}{2})'.format(
291 os.linesep, istring2, joinstring.join(buttons)) 291 os.linesep, istring2, joinstring.join(buttons))
292 defaultIndex = self.defaultCombo.currentIndex() 292 defaultIndex = self.defaultCombo.currentIndex()
318 parent = self.parentEdit.text() 318 parent = self.parentEdit.text()
319 if parent == "": 319 if parent == "":
320 parent = "None" 320 parent = "None"
321 321
322 if self.rAbout.isChecked(): 322 if self.rAbout.isChecked():
323 msgdlg = "QMessageBox.about({0}".format(os.linesep) 323 msgdlg = "QMessageBox.about("
324 elif self.rAboutQt.isChecked(): 324 elif self.rAboutQt.isChecked():
325 msgdlg = "QMessageBox.aboutQt({0}".format(os.linesep) 325 msgdlg = "QMessageBox.aboutQt("
326 elif self.rInformation.isChecked(): 326 elif self.rInformation.isChecked():
327 msgdlg = "res = QMessageBox.information({0}".format(os.linesep) 327 msgdlg = "res = QMessageBox.information("
328 elif self.rQuestion.isChecked(): 328 elif self.rQuestion.isChecked():
329 msgdlg = "res = QMessageBox.question({0}".format(os.linesep) 329 msgdlg = "res = QMessageBox.question("
330 elif self.rWarning.isChecked(): 330 elif self.rWarning.isChecked():
331 msgdlg = "res = QMessageBox.warning({0}".format(os.linesep) 331 msgdlg = "res = QMessageBox.warning("
332 else: 332 else:
333 msgdlg = "res = QMessageBox.critical({0}".format(os.linesep) 333 msgdlg = "res = QMessageBox.critical("
334 334
335 msgdlg += '{0}{1}{2}'.format(istring, parent, os.linesep) 335 if self.rAboutQt.isChecked():
336 msgdlg += '{0}self.trUtf8("{1}")'.format(istring, self.eCaption.text()) 336 if self.eCaption.text():
337 if not self.rAboutQt.isChecked(): 337 msgdlg += '{0}{1}{2}'.format(os.linesep, istring, parent)
338 msgdlg += ',{0}{1}self.trUtf8("{2}")'.format(
339 os.linesep, istring, self.eCaption.text())
340 else:
341 msgdlg += parent
342 else:
343 msgdlg += '{0}{1}{2}'.format(os.linesep, istring, parent)
344 msgdlg += ',{0}{1}self.trUtf8("{2}")'.format(
345 os.linesep, istring, self.eCaption.text())
338 msgdlg += ',{0}{1}self.trUtf8("""{2}""")'.format( 346 msgdlg += ',{0}{1}self.trUtf8("""{2}""")'.format(
339 os.linesep, istring, self.eMessage.toPlainText()) 347 os.linesep, istring, self.eMessage.toPlainText())
340 if not self.rAbout.isChecked() and not self.rAboutQt.isChecked(): 348 if not self.rAbout.isChecked() and not self.rAboutQt.isChecked():
341 msgdlg += self.__getButtonCode(istring, indString) 349 msgdlg += self.__getButtonCode(istring, indString)
342 msgdlg += '){0}'.format(estring) 350 msgdlg += '){0}'.format(estring)
343 return msgdlg 351 return msgdlg

eric ide

mercurial