Plugins/WizardPlugins/InputDialogWizard/InputDialogWizardDialog.py

changeset 3125
385a62b53725
parent 3124
a01e410893ac
child 3142
55030c09e142
child 3154
8578850cdc6a
diff -r a01e410893ac -r 385a62b53725 Plugins/WizardPlugins/InputDialogWizard/InputDialogWizardDialog.py
--- a/Plugins/WizardPlugins/InputDialogWizard/InputDialogWizardDialog.py	Mon Dec 02 19:54:31 2013 +0100
+++ b/Plugins/WizardPlugins/InputDialogWizard/InputDialogWizardDialog.py	Tue Dec 03 18:44:38 2013 +0100
@@ -125,13 +125,22 @@
         
         # 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 = "result"
         code = '{0}, ok = QInputDialog.'.format(resvar)
         if self.rText.isChecked():
             code += 'getText({0}{1}'.format(os.linesep, istring)
-            code += 'None,{0}{1}'.format(os.linesep, istring)
+            code += '{0},{1}{2}'.format(parent, os.linesep, istring)
             code += 'self.trUtf8("{0}"),{1}{2}'.format(
                 self.eCaption.text(), os.linesep, istring)
             code += 'self.trUtf8("{0}"),{1}{2}'.format(
@@ -148,7 +157,7 @@
             code += '){0}'.format(estring)
         elif self.rInteger.isChecked():
             code += 'getInt({0}{1}'.format(os.linesep, istring)
-            code += 'None,{0}{1}'.format(os.linesep, istring)
+            code += '{0},{1}{2}'.format(parent, os.linesep, istring)
             code += 'self.trUtf8("{0}"),{1}{2}'.format(
                 self.eCaption.text(), os.linesep, istring)
             code += 'self.trUtf8("{0}"),{1}{2}'.format(
@@ -170,7 +179,7 @@
             except ValueError:
                 doubleTo = 2147483647
             code += 'getDouble({0}{1}'.format(os.linesep, istring)
-            code += 'None,{0}{1}'.format(os.linesep, istring)
+            code += '{0},{1}{2}'.format(parent, os.linesep, istring)
             code += 'self.trUtf8("{0}"),{1}{2}'.format(
                 self.eCaption.text(), os.linesep, istring)
             code += 'self.trUtf8("{0}"),{1}{2}'.format(
@@ -180,7 +189,7 @@
                 self.sDoubleDecimals.value(), estring)
         elif self.rItem.isChecked():
             code += 'getItem({0}{1}'.format(os.linesep, istring)
-            code += 'None,{0}{1}'.format(os.linesep, istring)
+            code += '{0},{1}{2}'.format(parent, os.linesep, istring)
             code += 'self.trUtf8("{0}"),{1}{2}'.format(
                 self.eCaption.text(), os.linesep, istring)
             code += 'self.trUtf8("{0}"),{1}{2}'.format(

eric ide

mercurial