GNOME Bugzilla – Bug 590816
Migrate from libglade to GtkBuilder
Last modified: 2011-04-17 15:55:23 UTC
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
Created attachment 152930 [details] [review] this patch migrates g-p-m from libglade to gtkbuilder I attached a patch which can be considered as the first step in porting g-p-m to gtkbuilder. There is only some problems with the custom widgets that g-p-m uses. The E-phone-entry and Bluetooth-chooser-button custom widgets are made to work in a very ugly way and I could use some help with this issue. Currently, everything works with the two custom widgets but the bt-ch-button looks weird and narrow -though the functionality seems ok. E-phone-entry widget works perfectly fine as well, but I had to add the useless line "GtkWidget *ep = e_phone_entry_new ()" in ui_init for it to work, i.e. I couldn't find a way to properly initialise the e_phone_entry class for gtkbuilder to see it while the resource file is loaded. So, if someone could test the patch and shed some light on these two issues, it would be great.
I've tried to fix this bug in a similar way, but failing with the EPhoneEntry. My solution includes a separate Glade Catalog file for the BluetoothChooserButton. Looking into merging your with mine..
Created attachment 153103 [details] [review] fmarl partial fix Attaching my patch. This is incomplete because it does not fix the EPhoneEntry custom widget, but it has the glade catalog for the BluetoothChooserButton widget and other bits.
Created attachment 153134 [details] [review] porting from libglade to gtk-builder My patch updated with Mehmet findings. Thoughts? Opinions? Any possible improvement?
Review of attachment 153134 [details] [review]: ::: configure.in @@ +48,1 @@ PKG_CHECK_MODULES(PHONEMGR, gtk+-2.0 >= 2.10 glib-2.0 >= 2.13.0 You will need to bump the minimum GTK+ requirements to at least to 2.12. ::: data/Makefile.am @@ +6,2 @@ uidir = $(pkgdatadir) +ui_DATA = phonemgr.ui libephone.xml libgnome_bluetooth.xml Those last 2 shouldn't be needed. ::: data/libephone.xml @@ +1,1 @@ +<?xml version="1.0" encoding="UTF-8"?> No need for that. ::: data/libgnome_bluetooth.xml @@ +1,1 @@ +<?xml version="1.0" encoding="UTF-8"?> Or that. ::: src/ui.c @@ +39,2 @@ static void +boldify_label (GtkBuilder *builder, const char *name) You should be able to do that directly in the .ui file instead. @@ +135,3 @@ + if (widget != NULL) { + char *widgets[1]; + widgets[0] = malloc ( sizeof(widget) + 1); What is that? char **widgets[2] = { NULL, NULL }; widgets[0] = widget; and voila. No need to malloc or copy anything.
Francesco do you have any comment on Bastien's review?
Created attachment 178572 [details] [review] port from libglade to GtkBuilder Bastien: thanks for your review Here a new revised patch, I hope it can be pushed finally :)
Hello maintainers, could the Francesco patch get a second review? Thanks!
I committed his patch in January but I left this bug open.