Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py

changeset 3119
8b19074bb239
parent 2893
150de635fa29
child 3124
a01e410893ac
diff -r b1278ba1d7fe -r 8b19074bb239 Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py
--- a/Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py	Sat Nov 30 16:33:11 2013 +0100
+++ b/Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py	Sat Nov 30 18:01:00 2013 +0100
@@ -284,7 +284,7 @@
             return ""
         
         istring2 = istring + indString
-        joinstring = ' | \\{0}{1}'.format(os.linesep, istring2)
+        joinstring = ' |{0}{1}'.format(os.linesep, istring2)
         btnCode = ',{0}{1}QMessageBox.StandardButtons('.format(
             os.linesep, istring)
         btnCode += '{0}{1}{2})'.format(
@@ -320,24 +320,32 @@
                 parent = "None"
         
         if self.rAbout.isChecked():
-            msgdlg = "QMessageBox.about({0}".format(os.linesep)
+            msgdlg = "QMessageBox.about("
         elif self.rAboutQt.isChecked():
-            msgdlg = "QMessageBox.aboutQt({0}".format(os.linesep)
+            msgdlg = "QMessageBox.aboutQt("
         elif self.rInformation.isChecked():
-            msgdlg = "res = QMessageBox.information({0}".format(os.linesep)
+            msgdlg = "res = QMessageBox.information("
         elif self.rQuestion.isChecked():
-            msgdlg = "res = QMessageBox.question({0}".format(os.linesep)
+            msgdlg = "res = QMessageBox.question("
         elif self.rWarning.isChecked():
-            msgdlg = "res = QMessageBox.warning({0}".format(os.linesep)
+            msgdlg = "res = QMessageBox.warning("
         else:
-            msgdlg = "res = QMessageBox.critical({0}".format(os.linesep)
+            msgdlg = "res = QMessageBox.critical("
         
-        msgdlg += '{0}{1}{2}'.format(istring, parent, os.linesep)
-        msgdlg += '{0}self.trUtf8("{1}")'.format(istring, self.eCaption.text())
-        if not self.rAboutQt.isChecked():
+        if self.rAboutQt.isChecked():
+            if self.eCaption.text():
+                msgdlg += '{0}{1}{2}'.format(os.linesep, istring, parent)
+                msgdlg += ',{0}{1}self.trUtf8("{2}")'.format(
+                    os.linesep, istring, self.eCaption.text())
+            else:
+                msgdlg += parent
+        else:
+            msgdlg += '{0}{1}{2}'.format(os.linesep, istring, parent)
+            msgdlg += ',{0}{1}self.trUtf8("{2}")'.format(
+                os.linesep, istring, self.eCaption.text())
             msgdlg += ',{0}{1}self.trUtf8("""{2}""")'.format(
                 os.linesep, istring, self.eMessage.toPlainText())
-        if not self.rAbout.isChecked() and not self.rAboutQt.isChecked():
-            msgdlg += self.__getButtonCode(istring, indString)
+            if not self.rAbout.isChecked() and not self.rAboutQt.isChecked():
+                msgdlg += self.__getButtonCode(istring, indString)
         msgdlg += '){0}'.format(estring)
         return msgdlg

eric ide

mercurial