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 590816 - Migrate from libglade to GtkBuilder
Migrate from libglade to GtkBuilder
Status: RESOLVED FIXED
Product: gnome-phone-manager
Classification: Other
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: none
none
Depends on:
Blocks: 572883
 
 
Reported: 2009-08-05 09:48 UTC by Javier Jardón (IRC: jjardon)
Modified: 2011-04-17 15:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
this patch migrates g-p-m from libglade to gtkbuilder (70.23 KB, patch)
2010-02-03 16:04 UTC, Mehmet Giritli
none Details | Review
fmarl partial fix (124.08 KB, patch)
2010-02-05 20:24 UTC, Francesco Marella
none Details | Review
porting from libglade to gtk-builder (125.45 KB, patch)
2010-02-06 11:39 UTC, Francesco Marella
needs-work Details | Review
port from libglade to GtkBuilder (126.54 KB, patch)
2011-01-18 00:09 UTC, Francesco Marella
none Details | Review

Description Javier Jardón (IRC: jjardon) 2009-08-05 09:48:42 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
Comment 1 Mehmet Giritli 2010-02-03 16:04:06 UTC
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.
Comment 2 Francesco Marella 2010-02-05 18:19:37 UTC
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..
Comment 3 Francesco Marella 2010-02-05 20:24:28 UTC
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.
Comment 4 Francesco Marella 2010-02-06 11:39:14 UTC
Created attachment 153134 [details] [review]
porting from libglade to gtk-builder

My patch updated with Mehmet findings.

Thoughts? Opinions?
Any possible improvement?
Comment 5 Bastien Nocera 2010-12-10 15:36:37 UTC
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.
Comment 6 Daniele Forsi 2011-01-15 11:08:24 UTC
Francesco do you have any comment on Bastien's review?
Comment 7 Francesco Marella 2011-01-18 00:09:12 UTC
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 :)
Comment 8 Javier Jardón (IRC: jjardon) 2011-04-14 11:44:29 UTC
Hello maintainers, could the Francesco patch get a second review?

Thanks!
Comment 9 Daniele Forsi 2011-04-17 15:55:23 UTC
I committed his patch in January but I left this bug open.