Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py

branch
Py2 comp.
changeset 3056
9986ec0e559a
parent 2525
8b507a9a2d40
parent 2893
150de635fa29
child 3142
55030c09e142
--- a/Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py	Sun Sep 08 19:04:07 2013 +0200
+++ b/Plugins/WizardPlugins/MessageBoxWizard/MessageBoxWizardDialog.py	Tue Oct 15 22:03:54 2013 +0200
@@ -100,8 +100,8 @@
         
         self.defaultCombo.addItems(self.buttonsList)
         
-        self.bTest = \
-            self.buttonBox.addButton(self.trUtf8("Test"), QDialogButtonBox.ActionRole)
+        self.bTest = self.buttonBox.addButton(
+            self.trUtf8("Test"), QDialogButtonBox.ActionRole)
     
     def __testQt42(self):
         """
@@ -147,31 +147,36 @@
         if buttons == QMessageBox.NoButton:
             buttons = QMessageBox.Ok
         
-        defaultButton = self.buttonsCodeListBinary[self.defaultCombo.currentIndex()]
+        defaultButton = self.buttonsCodeListBinary[
+            self.defaultCombo.currentIndex()]
         
         if self.rInformation.isChecked():
-            QMessageBox.information(self,
+            QMessageBox.information(
+                self,
                 self.eCaption.text(),
                 self.eMessage.toPlainText(),
                 QMessageBox.StandardButtons(buttons),
                 defaultButton
             )
         elif self.rQuestion.isChecked():
-            QMessageBox.question(self,
+            QMessageBox.question(
+                self,
                 self.eCaption.text(),
                 self.eMessage.toPlainText(),
                 QMessageBox.StandardButtons(buttons),
                 defaultButton
             )
         elif self.rWarning.isChecked():
-            QMessageBox.warning(self,
+            QMessageBox.warning(
+                self,
                 self.eCaption.text(),
                 self.eMessage.toPlainText(),
                 QMessageBox.StandardButtons(buttons),
                 defaultButton
             )
         elif self.rCritical.isChecked():
-            QMessageBox.critical(self,
+            QMessageBox.critical(
+                self,
                 self.eCaption.text(),
                 self.eMessage.toPlainText(),
                 QMessageBox.StandardButtons(buttons),
@@ -193,12 +198,14 @@
         Private method to test the selected options.
         """
         if self.rAbout.isChecked():
-            QMessageBox.about(None,
+            QMessageBox.about(
+                None,
                 self.eCaption.text(),
                 self.eMessage.toPlainText()
             )
         elif self.rAboutQt.isChecked():
-            QMessageBox.aboutQt(None,
+            QMessageBox.aboutQt(
+                None,
                 self.eCaption.text()
             )
         else:
@@ -208,9 +215,9 @@
         """
         Private method to enable/disable some group boxes.
         """
-        self.standardButtons.setEnabled(not self.rAbout.isChecked() and \
+        self.standardButtons.setEnabled(not self.rAbout.isChecked() and
                                         not self.rAboutQt.isChecked()
-        )
+                                        )
         
         self.eMessage.setEnabled(not self.rAboutQt.isChecked())
     
@@ -280,11 +287,14 @@
         
         istring2 = istring + indString
         joinstring = ' | \\{0}{1}'.format(os.linesep, istring2)
-        btnCode = ',{0}{1}QMessageBox.StandardButtons('.format(os.linesep, istring)
-        btnCode += '{0}{1}{2})'.format(os.linesep, istring2, joinstring.join(buttons))
+        btnCode = ',{0}{1}QMessageBox.StandardButtons('.format(
+            os.linesep, istring)
+        btnCode += '{0}{1}{2})'.format(
+            os.linesep, istring2, joinstring.join(buttons))
         defaultIndex = self.defaultCombo.currentIndex()
         if defaultIndex:
-            btnCode += ',{0}{1}{2}'.format(os.linesep, istring,
+            btnCode += ',{0}{1}{2}'.format(
+                os.linesep, istring,
                 self.buttonsCodeListText[defaultIndex])
         return btnCode
     
@@ -312,18 +322,19 @@
                 parent = "None"
         
         if self.rAbout.isChecked():
-            msgdlg = "QMessageBox.about({0},{1}".format(parent, os.linesep)
+            msgdlg = "QMessageBox.about({0}".format(os.linesep)
         elif self.rAboutQt.isChecked():
-            msgdlg = "QMessageBox.aboutQt({0},{1}".format(parent, os.linesep)
+            msgdlg = "QMessageBox.aboutQt({0}".format(os.linesep)
         elif self.rInformation.isChecked():
-            msgdlg = "res = QMessageBox.information({0},{1}".format(parent, os.linesep)
+            msgdlg = "res = QMessageBox.information({0}".format(os.linesep)
         elif self.rQuestion.isChecked():
-            msgdlg = "res = QMessageBox.question({0},{1}".format(parent, os.linesep)
+            msgdlg = "res = QMessageBox.question({0}".format(os.linesep)
         elif self.rWarning.isChecked():
-            msgdlg = "res = QMessageBox.warning({0},{1}".format(parent, os.linesep)
+            msgdlg = "res = QMessageBox.warning({0}".format(os.linesep)
         else:
-            msgdlg = "res = QMessageBox.critical({0},{1}".format(parent, os.linesep)
+            msgdlg = "res = QMessageBox.critical({0}".format(os.linesep)
         
+        msgdlg += '{0}{1}{2}'.format(istring, parent, os.linesep)
         msgdlg += '{0}self.trUtf8("{1}")'.format(istring, self.eCaption.text())
         if not self.rAboutQt.isChecked():
             msgdlg += ',{0}{1}self.trUtf8("""{2}""")'.format(

eric ide

mercurial