Commit 093a2a15 authored by Tristan Van Berkom's avatar Tristan Van Berkom

- take into account cancelation of query dialog in add_parent action

	    code (bug 549685)


svn path=/trunk/; revision=1930
parent 9489e6b7
......@@ -17,7 +17,10 @@
* gladeui/glade-popup.c: Added devhelp icon to documentation menu item, added
docs icon to normal menu.
* plugins/gtk+/glade-gtk.c: insert before/after in box is working now (bug 550636).
* plugins/gtk+/glade-gtk.c:
- insert before/after in box is working now (bug 550636).
- take into account cancelation of query dialog in add_parent action
code (bug 549685)
2008-09-18 Christian Persch <chpe@gnome.org>
......
......@@ -1248,40 +1248,42 @@ glade_gtk_widget_action_activate (GladeWidgetAdaptor *adaptor,
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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment