gimp r26297 - in branches/soc-2008-python: . plug-ins/pygimp



Author: larsc
Date: Wed Jul 23 23:18:31 2008
New Revision: 26297
URL: http://svn.gnome.org/viewvc/gimp?rev=26297&view=rev

Log:
2008-07-24  Lars-Peter Clausen  <lars metafoo de>

	* plug-ins/pygimp/gimpui.override:
		(_wrap_gimp_dialog_new, _wrap_gimp_proc_view): Only try set the objects
	data after the object has been created.



Modified:
   branches/soc-2008-python/ChangeLog
   branches/soc-2008-python/plug-ins/pygimp/gimpui.override

Modified: branches/soc-2008-python/plug-ins/pygimp/gimpui.override
==============================================================================
--- branches/soc-2008-python/plug-ins/pygimp/gimpui.override	(original)
+++ branches/soc-2008-python/plug-ins/pygimp/gimpui.override	Wed Jul 23 23:18:31 2008
@@ -793,27 +793,6 @@
     if (pyg_flags_get_value(GTK_TYPE_DIALOG_FLAGS, py_flags, (gint *)&flags))
         return -1;
 
-    if (help_func) {
-        if (help_func != Py_None) {
-            if (!PyCallable_Check(help_func)) {
-                PyErr_SetString(PyExc_TypeError, "help_func must be callable");
-                return -1;
-            }
-
-            func = pygimp_help_func_marshal;
-
-            g_object_set_data(self->obj, "pygimp-dialog-help-data", self);
-
-            Py_INCREF(help_func);
-            g_object_set_data_full(self->obj, "pygimp-dialog-help-func",
-                                   help_func, pygimp_help_func_destroy);
-        } else {
-            func = gimp_standard_help_func;
-        }
-    } else {
-        func = gimp_standard_help_func;
-    }
-
     if (py_buttons == Py_None)
         len = 0;
     else if (PyTuple_Check(py_buttons))
@@ -829,6 +808,22 @@
         return -1;
     }
 
+    if (help_func) {
+        if (help_func != Py_None) {
+            if (!PyCallable_Check(help_func)) {
+                PyErr_SetString(PyExc_TypeError, "help_func must be callable");
+                return -1;
+            }
+
+            func = pygimp_help_func_marshal;
+
+       } else {
+            func = gimp_standard_help_func;
+        }
+    } else {
+        func = gimp_standard_help_func;
+    }
+
     pygobject_construct(self,
                         "title",     title,
                         "role",      role,
@@ -843,7 +838,7 @@
         return -1;
     }
 
-    if (parent) {
+   if (parent) {
         if (GTK_IS_WINDOW(parent))
             gtk_window_set_transient_for(GTK_WINDOW(self->obj),
                                          GTK_WINDOW(parent));
@@ -881,6 +876,14 @@
                                PyInt_AsLong(id));
     }
 
+    if (help_func && help_func != Py_None) {
+        g_object_set_data(self->obj, "pygimp-dialog-help-data", self);
+
+        Py_INCREF(help_func);
+        g_object_set_data_full(self->obj, "pygimp-dialog-help-func",
+                               help_func, pygimp_help_func_destroy);
+    }
+
     return 0;
 }
 %%
@@ -1416,27 +1419,6 @@
                                      &py_buttons))
         return -1;
 
-    if (help_func) {
-        if (help_func != Py_None) {
-            if (!PyCallable_Check(help_func)) {
-                PyErr_SetString(PyExc_TypeError, "help_func must be callable");
-                return -1;
-            }
-
-            func = pygimp_help_func_marshal;
-
-            g_object_set_data(self->obj, "pygimp-dialog-help-data", self);
-
-            Py_INCREF(help_func);
-            g_object_set_data_full(self->obj, "pygimp-dialog-help-func",
-                                   help_func, pygimp_help_func_destroy);
-        } else {
-            func = gimp_standard_help_func;
-        }
-    } else {
-        func = gimp_standard_help_func;
-    }
-
     if (py_buttons == Py_None)
         len = 0;
     else if (PyTuple_Check(py_buttons))
@@ -1454,6 +1436,22 @@
         return -1;
     }
 
+    if (help_func) {
+        if (help_func != Py_None) {
+            if (!PyCallable_Check(help_func)) {
+                PyErr_SetString(PyExc_TypeError, "help_func must be callable");
+                return -1;
+            }
+
+            func = pygimp_help_func_marshal;
+
+       } else {
+            func = gimp_standard_help_func;
+        }
+    } else {
+        func = gimp_standard_help_func;
+    }
+
     pygobject_construct(self,
                         "title",     title,
                         "role",      role,
@@ -1491,6 +1489,14 @@
                                PyInt_AsLong(id));
     }
 
+    if (help_func && help_func != Py_None) {
+        g_object_set_data(self->obj, "pygimp-dialog-help-data", self);
+
+        Py_INCREF(help_func);
+        g_object_set_data_full(self->obj, "pygimp-dialog-help-func",
+                               help_func, pygimp_help_func_destroy);
+    }
+
     g_signal_emit_by_name(GIMP_PROC_BROWSER_DIALOG(self->obj)->browser,
                           "search", "", 0, self->obj);
     return 0;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]