Bug#290811: Patch that fixes the problem in libglade

Margarita Manterola Margarita Manterola <debian@marga.com.ar>, 290811@bugs.debian.org
Sun, 23 Jan 2005 12:31:59 -0300


--QTprm0S8XgL7H0Dt
Content-Type: multipart/mixed; boundary="azLHFNyN32YCQGCU"
Content-Disposition: inline


--azLHFNyN32YCQGCU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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=3D163322

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.

--=20
 Bezitos,
     Maggie.

--azLHFNyN32YCQGCU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="libglade-patch.interdiff"
Content-Transfer-Encoding: quoted-printable

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=3Dlow
+
+  * Undo the update of the API, so that synaptic and meld keep working.
+
+ -- Margarita Manterola <debian@marga.com.ar>  Sun, 23 Jan 2005 11:49:01 -=
0300
+
 libglade2 (1:2.4.1-1) unstable; urgency=3Dlow
=20
   * 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);
=20
-	    if (new_group) {
-		GtkWidget *toolitem =3D 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));
=20
 	    /* FIXME: these should be translated */
 	    if (!strcmp (childinfo->child->classname, "toggle")) {
-		child =3D 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 =3D 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 =3D g_object_new (GTK_TYPE_RADIO_TOOL_BUTTON,
-				      "label", label,
-				      "stock_id", stock,
-				      NULL);
+		child =3D 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 =3D 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 =3D gtk_toolbar_append_item (
+		    GTK_TOOLBAR (parent),
+		    label, tooltip, NULL, iconw, NULL, NULL);
 	   =20
 	    /* GTK+ doesn't support use_underline directly, so we have to hack
 	       it. */
 	    if (use_underline) {
-		GtkWidget *labelw =3D gtk_tool_button_get_label_widget (GTK_TOOL_BUTTON =
(child));
-		gtk_label_set_use_underline (GTK_LABEL (labelw), TRUE);
+		GList *elem =3D g_list_last (GTK_TOOLBAR (parent)->children);
+		GtkToolbarChild *toolbar_child =3D elem->data;
+		gtk_label_set_use_underline (GTK_LABEL (toolbar_child->label),
+					     TRUE);
 	    }
=20
-	    if (tooltip) {
-		gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (child),
-					   xml->priv->tooltips,
-					   tooltip, NULL);
-	=09
-	    }
-
-	    gtk_container_add (GTK_CONTAINER (parent), child);
-
 	    glade_xml_set_common_params (xml, child, childinfo->child);
 	} else {
 	    child =3D glade_xml_build_widget (xml, childinfo->child);
-
-	    if (!GTK_IS_TOOL_ITEM (child)) {
-		GtkWidget *toolitem =3D GTK_WIDGET (gtk_tool_item_new ());
-
-		gtk_container_add (GTK_CONTAINER (toolitem), child);
-		gtk_widget_show (toolitem);
-		child =3D toolitem;
-	    }
-	    gtk_container_add (GTK_CONTAINER (parent), child);
+	    gtk_toolbar_append_widget (GTK_TOOLBAR (parent), child, NULL, NULL);
 	}
     }
 }

--azLHFNyN32YCQGCU--

--QTprm0S8XgL7H0Dt
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFB88NvlAuUx1tI/64RAvu3AJ9hVQhG5oZScdE5n6CLxp74yz5TswCfX84J
t0WQ/5BETxItnvQdOaeWox4=
=7igF
-----END PGP SIGNATURE-----

--QTprm0S8XgL7H0Dt--