GNOME Bugzilla – Bug 631717
Move from libglade to gtkbuilder
Last modified: 2010-10-19 19:15:49 UTC
Libglade is going the way of the dodo. Moreover, there have been hints that libglade support in glade will go away. If that happens, we cannot easily edit our gui files. We need to get an understanding of what a move consists of, apart from Makefile exercises.
Jean: you did this for goffice. What's involved in doing it?
First conversion of all .glade files, then some code change in the dialogs initialization, of course. There are at least two dialogs using GtkBuilder inside gnumeric (those using goffice helper functions).
I'll do the file conversion during the week-end. Seems that some have duplicate Ids.
There are also some features that are not supported in gtk+-2.12 such as GtkMenuBar in autoformat.glade. Well need to add them inthe code (or we request 2.16).
Would it be wise to do these changes in 1.10? I fear that we'll introduce some new bugs.
Since it is clearly not a mechanical process and not 1-to-1 I think we might want to wait for branching.
Created attachment 172019 [details] [review] sample patch This is kind of what has to be done for each dialog. Note that combo boxes, tree views, and possibly others, need more work. Also custom widgets are not supported by GtkBuilder.
It looks like the patch could shrink a lot if glade_xml_get_widget was changed to take a gpointer and tested for its object type in order to possibly call go_gtk_builder_get_widget.
Not sure since I also dropped state->gui.
Just converted all .glade files. Might be time to not change them anymore.
Comment on attachment 172019 [details] [review] sample patch Commited along with the fix to #631702. This one is simple enough to be sure that this is safe.
Created attachment 172545 [details] [review] Proposed patch Needs testing, especially, I'm anticipating issues with combo boxes, even if I couldn't find any. But I did not test every feature in every dialog.
I want to do some changes first so this patch can be reduced to something that is easier to review. 1. Introduce gnm_xml_get_widget that calls either glade_xml_get_widget or go_gtk_builder_get_widget. 2. Rename gnumeric_glade_group_value to gnm_gui_group_value and make it work for both glade and gtkbuilder.
Done. Now updating patch.
Created attachment 172626 [details] [review] Updated patch This shrinks the patch 50%+ A further 25% can be had for visual inspection by applying and doing "git diff -w".
Created attachment 172666 [details] [review] Life cycle patch With this patch, all the changes to life cycle seem to be unnecessary. We can keep the g_object_set_data_full calls and avoid gnm_dialog_attach_state and its worries over double calls.
Review of attachment 172666 [details] [review]: Looks good.
Hmm, the destroy signal is also used for goffice dialogs. If the signal was called several times, gnumeric would crash a lot when using the graph guru.
It's more or a "can be called several times" than "will be".
Created attachment 172728 [details] [review] Updated patch We're down to 114k (from original 412k).
Created attachment 172752 [details] [review] Updated patch 87k...
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report. The following dialogs should be double checked as the patch is non-trivial in these cases: auto format auto save preferences printer setup