After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 582503 - Use GtkBuilder instead of libglade
Use GtkBuilder instead of libglade
Status: RESOLVED FIXED
Product: gnome-system-tools
Classification: Deprecated
Component: general
CVS latest
Other Linux
: Normal normal
: ---
Assigned To: Milan Bouchet-Valat
Carlos Garnacho
Depends on:
Blocks: 102134 572883
 
 
Reported: 2009-05-13 17:38 UTC by André Klapper
Modified: 2009-07-25 21:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use GtkBuilder instead of libglade (22.58 KB, patch)
2009-05-22 07:15 UTC, Javier Jardón (IRC: jjardon)
needs-work Details | Review
Use GtkBuilder instead of libglade v2 (746.34 KB, patch)
2009-07-17 21:59 UTC, Javier Jardón (IRC: jjardon)
committed Details | Review

Description André Klapper 2009-05-13 17:38:05 UTC
According to http://www.gnome.org/~fpeters/299.html
this module depends on libglade.

In GNOME 2.27, libglade has been deprecated in favor of GtkBuilder. See
http://library.gnome.org/devel/gtk/stable/gtk-migrating-GtkBuilder.html for
migration instructions. Also see
http://live.gnome.org/GnomeGoals/RemoveLibGladeUseGtkBuilder
Comment 1 Javier Jardón (IRC: jjardon) 2009-05-22 07:15:18 UTC
Created attachment 135158 [details] [review]
Use GtkBuilder instead of libglade

There are changes in the files m4/intltool.m4 and po/Makefile.in.in but I think that don't matter because these files are generated when you execute the autogen

If not, please tell me
Comment 2 André Klapper 2009-06-29 19:16:26 UTC
gnome-system-tools is basically unmaintained so I wonder who could review this.
Comment 3 Cosimo Cecchi 2009-06-29 23:25:00 UTC
Comment on attachment 135158 [details] [review]
Use GtkBuilder instead of libglade

Please drop all the changes in m4/intltool.m4 and po/Makefile.in.in from the patch.
If those files are modified at build time and are under version control, that's another bug.

>diff --git a/src/boot/boot-append-gui.c b/src/boot/boot-append-gui.c

>+           if (!gtk_builder_add_from_file (builder, tool->ui_path, &error))
>+             {
>+               g_warning ("Couldn't load builder file: %s", error->message);
>+               g_error_free (error);
>+             }

You should probably return NULL here.

>@@ -495,7 +502,7 @@ boot_append_gui_destroy (BootAppendGui *gui)

>+			 g_object_unref (G_OBJECT (gui->builder));

No need to cast to GObject* here.

>diff --git a/src/boot/boot-settings.c b/src/boot/boot-settings.c

>+	if (!gtk_builder_add_from_file (builder, ui_path, &error))
>+	{
>+		g_warning ("Couldn't load builder file: %s", error->message);
>+		g_error_free (error);
>+	}

You should return NULL here.

>@@ -441,7 +448,7 @@ boot_settings_gui_destroy (BootSettingsGui *gui)

>+		g_object_unref (G_OBJECT (gui->builder));

Useless cast.

>diff --git a/src/boot/callbacks.c b/src/boot/callbacks.c
>@@ -91,20 +91,27 @@ static BootImageEditor *
>+	if (!gtk_builder_add_from_file (builder, boot_dialog, &error))
>+	{
>+		g_warning ("Couldn't load builder file: %s", error->message);
>+		g_error_free (error);
>+	}

>@@ -189,20 +196,26 @@ static BootAppendEditor *

>+	if (!gtk_builder_add_from_file (builder, boot_dialog, &error))
>+	{
>+		g_warning ("Couldn't load builder file: s", error->message);
>+		g_error_free (error);
>+	}
>+	new->dialog = GTK_DIALOG (gtk_builder_get_object (builder, "boot_dialog"));

Same here.

>+	g_signal_connect (G_OBJECT (gtk_builder_get_object (builder, "boot_dialog_help")),
> 			  "clicked", G_CALLBACK (on_boot_help_button_clicked), NULL);

Useless cast.


Apart from these nitpicks you should also:
- add the converted UI file to the patch (using git-add) and remove the glade one (with git-rm)
- replace the glade file in the po/POTFILES.in list with the UI one, prefixing it with [type: gettext/glade]
- remove the glade bits from configure.ac (and Makefile.am if appropriate)
Comment 4 André Klapper 2009-07-17 14:04:39 UTC
Javier: Willing to come up with an updated patch that covers Cosimo's comments?
Comment 5 Javier Jardón (IRC: jjardon) 2009-07-17 21:59:10 UTC
Created attachment 138643 [details] [review]
Use GtkBuilder instead of libglade v2
Comment 6 Javier Jardón (IRC: jjardon) 2009-07-17 21:59:54 UTC
Sorry, I completely forgot this patch. Thank you André for the reminder ;)
Comment 7 Kjartan Maraas 2009-07-19 16:48:49 UTC
Should we just commit this?
Comment 8 André Klapper 2009-07-19 17:06:14 UTC
Let's ask Milan if he's fine with getting this in.
Comment 9 Milan Bouchet-Valat 2009-07-25 21:43:31 UTC
I've had a look at the patch and it looks good to me, I trust you for the details. Tested here and that works, only updated to take into account changes made to interfaces/users.ui since the patch was posted.

Much thanks for the patch Javier (and Cosimo for the review), it's really nice to get such great work in the g-s-t! And that will make maintaining easier now that the .glade files are not duplicated - not speaking about the g-s-t eventually moving towards GNOME 3.0. Now that you've worked with the g-s-t codebase, what about helping us further? ;-)

Pushed as 0ac0ac85f50b6bd016249278e946ad3e0862fc5a and d69ce5c2c9df3b860adddb41879b40585b67e264. I've updated the Wiki page.