glade3 r1930 - in trunk: . plugins/gtk+
- From: tvb svn gnome org
- To: svn-commits-list gnome org
- Subject: glade3 r1930 - in trunk: . plugins/gtk+
- Date: Thu, 18 Sep 2008 20:13:51 +0000 (UTC)
Author: tvb
Date: Thu Sep 18 20:13:51 2008
New Revision: 1930
URL: http://svn.gnome.org/viewvc/glade3?rev=1930&view=rev
Log:
- take into account cancelation of query dialog in add_parent action
code (bug 549685)
Modified:
trunk/ChangeLog
trunk/plugins/gtk+/glade-gtk.c
Modified: trunk/plugins/gtk+/glade-gtk.c
==============================================================================
--- trunk/plugins/gtk+/glade-gtk.c (original)
+++ trunk/plugins/gtk+/glade-gtk.c Thu Sep 18 20:13:51 2008
@@ -1248,40 +1248,42 @@
project = glade_widget_get_project (gparent);
else
project = glade_app_get_project ();
+
/* Create new widget and put it where the placeholder was */
- that_widget.data =
- glade_command_create (adaptor, gparent, NULL,
- project);
-
-
- /* Remove the alignment that we added in the frame's post_create... */
- if (new_type == GTK_TYPE_FRAME)
+ if ((that_widget.data =
+ glade_command_create (adaptor, gparent, NULL, project)) != NULL)
{
- GObject *frame = glade_widget_get_object (that_widget.data);
- GladeWidget *galign = glade_widget_get_from_gobject (GTK_BIN (frame)->child);
- GList to_delete = { 0, };
-
- to_delete.data = galign;
- glade_command_delete (&to_delete);
- }
-
- /* Create heavy-duty glade-command properties stuff */
- prop_cmds = create_command_property_list (that_widget.data, saved_props);
- g_list_foreach (saved_props, (GFunc)g_object_unref, NULL);
- g_list_free (saved_props);
-
- /* Apply the properties in an undoable way */
- if (prop_cmds)
- glade_command_set_properties_list (glade_widget_get_project (gparent), prop_cmds);
-
- /* Add "this" widget to the new parent */
- glade_command_paste(&this_widget, GLADE_WIDGET (that_widget.data), NULL);
+ /* Remove the alignment that we added in the frame's post_create... */
+ if (new_type == GTK_TYPE_FRAME)
+ {
+ GObject *frame = glade_widget_get_object (that_widget.data);
+ GladeWidget *galign = glade_widget_get_from_gobject (GTK_BIN (frame)->child);
+ GList to_delete = { 0, };
+
+ to_delete.data = galign;
+ glade_command_delete (&to_delete);
+ }
+
+ /* Create heavy-duty glade-command properties stuff */
+ prop_cmds = create_command_property_list (that_widget.data, saved_props);
+ g_list_foreach (saved_props, (GFunc)g_object_unref, NULL);
+ g_list_free (saved_props);
+
+ /* Apply the properties in an undoable way */
+ if (prop_cmds)
+ glade_command_set_properties_list (glade_widget_get_project (gparent), prop_cmds);
+
+ /* Add "this" widget to the new parent */
+ glade_command_paste(&this_widget, GLADE_WIDGET (that_widget.data), NULL);
+ }
+ else
+ /* Create parent was cancelled, paste back to parent */
+ glade_command_paste(&this_widget, gparent, NULL);
+
glade_command_pop_group ();
}
-
}
-
else
GWA_GET_CLASS (G_TYPE_OBJECT)->action_activate (adaptor,
object,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]