Plugins/WizardPlugins/ColorDialogWizard/ColorDialogWizardDialog.py

changeset 3125
385a62b53725
parent 3124
a01e410893ac
child 3142
55030c09e142
child 3160
209a07d7e401
--- a/Plugins/WizardPlugins/ColorDialogWizard/ColorDialogWizardDialog.py	Mon Dec 02 19:54:31 2013 +0100
+++ b/Plugins/WizardPlugins/ColorDialogWizard/ColorDialogWizardDialog.py	Tue Dec 03 18:44:38 2013 +0100
@@ -122,7 +122,15 @@
         estring = os.linesep + indLevel * indString
         
         # now generate the code
-        # TODO: support entering 'parent'
+        if self.parentSelf.isChecked():
+            parent = "self"
+        elif self.parentNone.isChecked():
+            parent = "None"
+        elif self.parentOther.isChecked():
+            parent = self.parentEdit.text()
+            if parent == "":
+                parent = "None"
+        
         resvar = self.eResultVar.text()
         if not resvar:
             resvar = "color"
@@ -139,7 +147,7 @@
                         istring, col, os.linesep)
             else:
                 code += '{0}QColor(Qt.white),{1}'.format(istring, os.linesep)
-            code += '{0}None,{1}'.format(istring, os.linesep)
+            code += '{0}{1},{2}'.format(istring, parent, os.linesep)
             code += '{0}self.trUtf8("{1}"),{2}'.format(
                 istring, self.eTitle.text(), os.linesep)
             code += '{0}QColorDialog.ColorDialogOptions(' \
@@ -154,7 +162,7 @@
             else:
                 code += '{0}{1},{2}'.format(
                     istring, self.eRGB.text(), os.linesep)
-            code += '{0}None,{1}'.format(istring, os.linesep)
+            code += '{0}{1},{2}'.format(istring, parent, os.linesep)
             code += '{0}self.trUtf8("{1}"),{2}'.format(
                 istring, self.eTitle.text(), os.linesep)
             code += '{0}QColorDialog.ColorDialogOptions(' \

eric ide

mercurial