[glade] Made glade_command_dnd() accept parent and placeholer NULL parameter to paste the widget as toplevel



commit 9bcdb816e637118d48bc983a42a35224dc82bcd7
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Mon Dec 17 22:34:12 2012 -0300

    Made glade_command_dnd() accept parent and placeholer NULL parameter to paste the widget as toplevel.

 gladeui/glade-command.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/gladeui/glade-command.c b/gladeui/glade-command.c
index 4409b10..7d77c68 100644
--- a/gladeui/glade-command.c
+++ b/gladeui/glade-command.c
@@ -1773,18 +1773,22 @@ glade_command_dnd (GList *widgets,
   GladeProject *project;
 
   g_return_if_fail (widgets != NULL);
-  g_return_if_fail (parent || placeholder);
 
+  widget = widgets->data;
+  
   if (parent)
     project = glade_widget_get_project (parent);
-  else
+  else if (placeholder)
     project = glade_placeholder_get_project (placeholder);
+  else
+    project = glade_widget_get_project (widget);
 
-  widget = widgets->data;
-  glade_command_push_group (_("Drag-n-Drop from %s to %s"),
-                            glade_widget_get_name (parent),
+  g_return_if_fail (project);
+  
+  glade_command_push_group (_("Drag %s and Drop to %s"),
                             g_list_length (widgets) == 1 ? 
-			    glade_widget_get_name (widget) : _("multiple"));
+			    glade_widget_get_name (widget) : _("multiple"),
+                            parent ? glade_widget_get_name (parent) : _("root"));
   glade_command_remove (widgets);
   glade_command_add (widgets, parent, placeholder, project, TRUE);
   glade_command_pop_group ();



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