Merge 288445 287167 290811
Tags 290811 +patch
thanks

I'm attaching a patch that fixes these bugs.

They were all the same bug: libglade2 made an important update in the code
of glade-gtk.c that started using the new toolbar api.  This change
rendered programs that used both glade and the toolbar api directly
unusable.

Upstream report: http://bugzilla.gnome.org/show_bug.cgi?id=163322

The patch I'm attaching was made with interdiff. It is indended to make the
less damage possible.  I only regressed those changes that affected the way
meld and synaptic behaved (I don't know if there are other programs
affected by this bug).

With these changes, the two programs behave properly, almost no warnings
issued on the console. I hope you find this patch worthy of applying.

-- 
 Bezitos,
     Maggie.
diff -u libglade2-2.4.1/debian/changelog libglade2-2.4.1/debian/changelog
--- libglade2-2.4.1/debian/changelog
+++ libglade2-2.4.1/debian/changelog
@@ -1,3 +1,9 @@
+libglade2 (1:2.4.1-1.1) unstable; urgency=low
+
+  * Undo the update of the API, so that synaptic and meld keep working.
+
+ -- Margarita Manterola <[EMAIL PROTECTED]>  Sun, 23 Jan 2005 11:49:01 -0300
+
 libglade2 (1:2.4.1-1) unstable; urgency=low
 
   * GNOME team upload.
only in patch2:
unchanged:
--- libglade2-2.4.1.orig/glade/glade-gtk.c
+++ libglade2-2.4.1/glade/glade-gtk.c
@@ -868,71 +868,46 @@
            if (iconw)
                gtk_widget_show (iconw);
 
-           if (new_group) {
-               GtkWidget *toolitem = GTK_WIDGET (gtk_tool_item_new ());
-
-               gtk_container_add (GTK_CONTAINER (parent), toolitem);
-               gtk_widget_show (toolitem);
-           }
+           if (new_group)
+               gtk_toolbar_append_space (GTK_TOOLBAR (parent));
 
            /* FIXME: these should be translated */
            if (!strcmp (childinfo->child->classname, "toggle")) {
-               child = g_object_new (GTK_TYPE_TOGGLE_TOOL_BUTTON,
-                                     "label", label,
-                                     "stock_id", stock,
-                                     NULL);
-               gtk_toggle_tool_button_set_active
-                   (GTK_TOGGLE_TOOL_BUTTON (child), active);
+               child = gtk_toolbar_append_element (
+                   GTK_TOOLBAR (parent),
+                   GTK_TOOLBAR_CHILD_TOGGLEBUTTON, NULL,
+                   label, tooltip, NULL, iconw, NULL, NULL);
+               gtk_toggle_button_set_active(
+                   GTK_TOGGLE_BUTTON (child), active);
            } else if (!strcmp (childinfo->child->classname, "radio")) {
-               child = g_object_new (GTK_TYPE_RADIO_TOOL_BUTTON,
-                                     "label", label,
-                                     "stock_id", stock,
-                                     NULL);
+               child = gtk_toolbar_append_element (
+                   GTK_TOOLBAR (parent),
+                   GTK_TOOLBAR_CHILD_RADIOBUTTON, NULL,
+                   label, tooltip, NULL, iconw, NULL, NULL);
+
                if (group_name) {
                    g_object_set (G_OBJECT (child),
                                  "group", glade_xml_get_widget (xml, 
group_name),
                                  NULL);
                }
-               gtk_toggle_tool_button_set_active
-                   (GTK_TOGGLE_TOOL_BUTTON (child), active);
-           } else {
-               child = g_object_new (GTK_TYPE_TOOL_BUTTON,
-                                     "label", label,
-                                     "stock_id", stock,
-                                     NULL);
-           }
-           if (iconw)
-               gtk_tool_button_set_icon_widget (GTK_TOOL_BUTTON (child),
-                                                iconw);
+           } else
+               child = gtk_toolbar_append_item (
+                   GTK_TOOLBAR (parent),
+                   label, tooltip, NULL, iconw, NULL, NULL);
            
            /* GTK+ doesn't support use_underline directly, so we have to hack
               it. */
            if (use_underline) {
-               GtkWidget *labelw = gtk_tool_button_get_label_widget 
(GTK_TOOL_BUTTON (child));
-               gtk_label_set_use_underline (GTK_LABEL (labelw), TRUE);
+               GList *elem = g_list_last (GTK_TOOLBAR (parent)->children);
+               GtkToolbarChild *toolbar_child = elem->data;
+               gtk_label_set_use_underline (GTK_LABEL (toolbar_child->label),
+                                            TRUE);
            }
 
-           if (tooltip) {
-               gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (child),
-                                          xml->priv->tooltips,
-                                          tooltip, NULL);
-               
-           }
-
-           gtk_container_add (GTK_CONTAINER (parent), child);
-
            glade_xml_set_common_params (xml, child, childinfo->child);
        } else {
            child = glade_xml_build_widget (xml, childinfo->child);
-
-           if (!GTK_IS_TOOL_ITEM (child)) {
-               GtkWidget *toolitem = GTK_WIDGET (gtk_tool_item_new ());
-
-               gtk_container_add (GTK_CONTAINER (toolitem), child);
-               gtk_widget_show (toolitem);
-               child = toolitem;
-           }
-           gtk_container_add (GTK_CONTAINER (parent), child);
+           gtk_toolbar_append_widget (GTK_TOOLBAR (parent), child, NULL, NULL);
        }
     }
 }

Attachment: signature.asc
Description: Digital signature

Reply via email to