[glade/glade-3-10] Replaced deprecated GtkHBox, GtkVBox, GtkHPaned and GtkVPaned types in add parent action with new in



commit 6ef66a093bca6412525a2ec1974014e5251ad6e4
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Wed Jul 6 15:42:27 2011 -0300

    Replaced deprecated GtkHBox, GtkVBox, GtkHPaned and GtkVPaned types in
    add parent action with new instantiable types GtkBox and GtkPaned.
    
    Fixed bug #654098 "No way to add GtkBox or GtkPaned from the context menu"

 plugins/gtk+/glade-gtk.c |   34 +++++++++++++++-------------------
 plugins/gtk+/gtk+.xml.in |   23 ++++++++++-------------
 2 files changed, 25 insertions(+), 32 deletions(-)
---
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index 09f73d2..8a45d8e 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -836,41 +836,37 @@ glade_gtk_widget_action_activate (GladeWidgetAdaptor * adaptor,
     }
   else if (strncmp (action_path, "add_parent/", 11) == 0)
     {
+      const gchar *action = action_path + 11;
       GType new_type = 0;
-      GladeProperty *property;
 
-      if (strcmp (action_path + 11, "alignment") == 0)
+      if (strcmp (action, "alignment") == 0)
         new_type = GTK_TYPE_ALIGNMENT;
-      else if (strcmp (action_path + 11, "viewport") == 0)
+      else if (strcmp (action, "viewport") == 0)
         new_type = GTK_TYPE_VIEWPORT;
-      else if (strcmp (action_path + 11, "eventbox") == 0)
+      else if (strcmp (action, "eventbox") == 0)
         new_type = GTK_TYPE_EVENT_BOX;
-      else if (strcmp (action_path + 11, "frame") == 0)
+      else if (strcmp (action, "frame") == 0)
         new_type = GTK_TYPE_FRAME;
-      else if (strcmp (action_path + 11, "aspect_frame") == 0)
+      else if (strcmp (action, "aspect_frame") == 0)
         new_type = GTK_TYPE_ASPECT_FRAME;
-      else if (strcmp (action_path + 11, "scrolled_window") == 0)
+      else if (strcmp (action, "scrolled_window") == 0)
         new_type = GTK_TYPE_SCROLLED_WINDOW;
-      else if (strcmp (action_path + 11, "expander") == 0)
+      else if (strcmp (action, "expander") == 0)
         new_type = GTK_TYPE_EXPANDER;
-      else if (strcmp (action_path + 11, "table") == 0)
+      else if (strcmp (action, "table") == 0)
         new_type = GTK_TYPE_TABLE;
-      else if (strcmp (action_path + 11, "hbox") == 0)
-        new_type = GTK_TYPE_HBOX;
-      else if (strcmp (action_path + 11, "vbox") == 0)
-        new_type = GTK_TYPE_VBOX;
-      else if (strcmp (action_path + 11, "hpaned") == 0)
-        new_type = GTK_TYPE_HPANED;
-      else if (strcmp (action_path + 11, "vpaned") == 0)
-        new_type = GTK_TYPE_VPANED;
-
+      else if (strcmp (action, "box") == 0)
+        new_type = GTK_TYPE_BOX;
+      else if (strcmp (action, "paned") == 0)
+        new_type = GTK_TYPE_PANED;
 
       if (new_type)
         {
           GladeWidgetAdaptor *adaptor =
-              glade_widget_adaptor_get_by_type (new_type);
+            glade_widget_adaptor_get_by_type (new_type);
           GList *saved_props, *prop_cmds;
 	  GladeWidget *gnew_parent;
+          GladeProperty *property;
 
           /* Dont add non-scrollable widgets to scrolled windows... */
           if (gparent &&
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index 4ce6056..7d74f25 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -1,6 +1,5 @@
 <glade-catalog name="gtk+"
 	       version="3.0"
-	       targetable="2.24,2.22,2.20"
                icon-prefix="gtk"
                library="gladegtk"
                domain="glade3"
@@ -34,18 +33,16 @@
         <action id="edit_separate" _name="Edit Separately" stock="gtk-edit"/>
         <action id="remove_parent" _name="Remove Parent" stock="gtk-remove"/>
         <action id="add_parent" _name="Add Parent" stock="gtk-add">
-	  <action id="alignment" _name="Alignment"/>
-	  <action id="viewport" _name="Viewport"/>
-	  <action id="eventbox" _name="Event Box"/>
-	  <action id="frame" _name="Frame"/>
-	  <action id="aspect_frame" _name="Aspect Frame"/>
-	  <action id="scrolled_window" _name="Scrolled Window"/>
-	  <action id="expander" _name="Expander"/>
-	  <action id="table" _name="Table"/>
-	  <action id="hbox" _name="Horizontal Box"/>
-	  <action id="vbox" _name="Vertical Box"/>
-	  <action id="hpaned" _name="Horizontal Panes"/>
-	  <action id="vpaned" _name="Vertical Panes"/>
+          <action id="alignment" _name="Alignment"/>
+          <action id="viewport" _name="Viewport"/>
+          <action id="eventbox" _name="Event Box"/>
+          <action id="frame" _name="Frame"/>
+          <action id="aspect_frame" _name="Aspect Frame"/>
+          <action id="scrolled_window" _name="Scrolled Window"/>
+          <action id="expander" _name="Expander"/>
+          <action id="table" _name="Table"/>
+          <action id="box" _name="Box"/>
+          <action id="paned" _name="Paned"/>
         </action>
 	<action id="sizegroup_add" _name="Add to Size Group"/>
       </actions>



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