Only try set the objects data after the object has been created.

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.


svn path=/branches/soc-2008-python/; revision=26297
This commit is contained in:
Lars-Peter Clausen 2008-07-23 23:18:31 +00:00 committed by Lars-Peter Clausen
parent 8b1b5015ea
commit ac10f3950a
2 changed files with 59 additions and 47 deletions

View File

@ -1,23 +1,29 @@
2008-07-24 Lars-Peter Clausen <lars@metafoo.de>
* plug-ins/pygimp/gimpui.override
(_wrap_gimp_dialog_new, _wrap_gimp_proc_browser_dialog): Only try set
the objects data after the object has been created.
2008-07-24 Lars-Peter Clausen <lars@metafoo.de>
* plug-ins/pygimp/pygimp-drawable.c: Initialise self->drawable in lay_init
and chn_init
and chn_init.
2008-07-23 Lars-Peter Clausen <lars@metafoo.de>
* plug-ins/pygimp/gimpui.override: Wrapped GimpAspectpreview,
GimpDrawablePreview and GimpZoomPrewview constructors
GimpDrawablePreview and GimpZoomPrewview constructors.
2008-07-23 Lars-Peter Clausen <lars@metafoo.de>
* plug-ins/pygimp/pygimp-drawable.c: Fixed usage of GimpDrawable
* plug-ins/pygimp/pygimp-drawable.c: Fixed usage of GimpDrawable.
2008-07-04 Lars-Peter Clausen <lars@metafoo.de>
* plug-ins/pygimp/pygimp-tile.c
* plug-ins/pygimp/pygimp-drawable.c
* plug-ins/pygimp/pygimp-vectors.c
* plug-ins/pygimp/gimpmodile.c: Fixed some potential crashes
* plug-ins/pygimp/gimpmodile.c: Fixed some potential crashes.
2008-06-30 Lars-Peter Clausen <lars@metafoo.de>

View File

@ -793,27 +793,6 @@ _wrap_gimp_dialog_new(PyGObject *self, PyObject *args, PyObject *kwargs)
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 @@ _wrap_gimp_dialog_new(PyGObject *self, PyObject *args, PyObject *kwargs)
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 @@ _wrap_gimp_dialog_new(PyGObject *self, PyObject *args, PyObject *kwargs)
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 @@ _wrap_gimp_dialog_new(PyGObject *self, PyObject *args, PyObject *kwargs)
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 @@ _wrap_gimp_proc_browser_dialog_new(PyGObject *self, PyObject *args,
&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 @@ _wrap_gimp_proc_browser_dialog_new(PyGObject *self, PyObject *args,
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 @@ _wrap_gimp_proc_browser_dialog_new(PyGObject *self, PyObject *args,
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;