Plugins/WizardPlugins/E5MessageBoxWizard/E5MessageBoxWizardDialog.py

branch
Py2 comp.
changeset 3142
55030c09e142
parent 3060
5883ce99ee12
parent 3124
a01e410893ac
child 3145
a9de05d4a22f
--- a/Plugins/WizardPlugins/E5MessageBoxWizard/E5MessageBoxWizardDialog.py	Fri Dec 13 22:45:47 2013 +0100
+++ b/Plugins/WizardPlugins/E5MessageBoxWizard/E5MessageBoxWizardDialog.py	Fri Dec 13 23:39:14 2013 +0100
@@ -422,7 +422,7 @@
             return ""
         
         istring2 = istring + indString
-        joinstring = ' | \\{0}{1}'.format(os.linesep, istring2)
+        joinstring = ' |{0}{1}'.format(os.linesep, istring2)
         if withIntro:
             btnCode = ',{0}{1}E5MessageBox.StandardButtons('.format(
                 os.linesep, istring)
@@ -482,28 +482,37 @@
             icon = "E5MessageBox.Critical"
         
         if not self.rStandard.isChecked():
+            resvar = self.eResultVar.text()
+            if not resvar:
+                resvar = "res"
+            
             if self.rAbout.isChecked():
                 msgdlg = "E5MessageBox.about({0}".format(os.linesep)
             elif self.rAboutQt.isChecked():
                 msgdlg = "E5MessageBox.aboutQt({0}".format(os.linesep)
             elif self.rInformation.isChecked():
-                msgdlg = "res = E5MessageBox.information({0}".format(
-                    os.linesep)
+                msgdlg = "{0} = E5MessageBox.information({1}".format(
+                    resvar, os.linesep)
             elif self.rQuestion.isChecked():
-                msgdlg = "res = E5MessageBox.question({0}".format(os.linesep)
+                msgdlg = "{0} = E5MessageBox.question({1}".format(
+                    resvar, os.linesep)
             elif self.rWarning.isChecked():
-                msgdlg = "res = E5MessageBox.warning({0}".format(os.linesep)
+                msgdlg = "{0} = E5MessageBox.warning({1}".format(
+                    resvar, os.linesep)
             elif self.rCritical.isChecked():
-                msgdlg = "res = E5MessageBox.critical({0}".format(os.linesep)
+                msgdlg = "{0} = E5MessageBox.critical({1}".format(
+                    resvar, os.linesep)
             elif self.rYesNo.isChecked():
-                msgdlg = "res = E5MessageBox.yesNo({0}".format(os.linesep)
+                msgdlg = "{0} = E5MessageBox.yesNo({1}".format(
+                    resvar, os.linesep)
             elif self.rRetryAbort.isChecked():
-                msgdlg = "res = E5MessageBox.retryAbort({0}".format(os.linesep)
+                msgdlg = "{0} = E5MessageBox.retryAbort({1}".format(
+                    resvar, os.linesep)
             elif self.rOkToClearData.isChecked():
-                msgdlg = "res = E5MessageBox.okToClearData({0}".format(
-                    os.linesep)
+                msgdlg = "{0} = E5MessageBox.okToClearData({1}".format(
+                    resvar, os.linesep)
             
-            msgdlg += '{0}{1}{2}'.format(istring, parent, os.linesep)
+            msgdlg += '{0}{1},{2}'.format(istring, parent, os.linesep)
             msgdlg += '{0}self.trUtf8("{1}")'.format(
                 istring, self.eCaption.text())
             
@@ -534,8 +543,13 @@
                     saveFunc = "lambda: True"
                 msgdlg += ',{0}{1}{2}'.format(os.linesep, istring, saveFunc)
         else:
-            msgdlg = "E5MessageBox.E5MessageBox({0}".format(os.linesep)
-            msgdlg += '{0}{1}{2}'.format(istring, icon, os.linesep)
+            resvar = self.eResultVar.text()
+            if not resvar:
+                resvar = "dlg"
+            
+            msgdlg = "{0} = E5MessageBox.E5MessageBox({1}".format(
+                resvar, os.linesep)
+            msgdlg += '{0}{1},{2}'.format(istring, icon, os.linesep)
             msgdlg += '{0}self.trUtf8("{1}")'.format(
                 istring, self.eCaption.text())
             msgdlg += ',{0}{1}self.trUtf8("""{2}""")'.format(

eric ide

mercurial