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 631717 - Move from libglade to gtkbuilder
Move from libglade to gtkbuilder
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: GUI
git master
Other All
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-10-08 22:53 UTC by Morten Welinder
Modified: 2010-10-19 19:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample patch (3.29 KB, patch)
2010-10-09 15:02 UTC, Jean Bréfort
committed Details | Review
Proposed patch (411.99 KB, patch)
2010-10-17 13:28 UTC, Jean Bréfort
none Details | Review
Updated patch (194.82 KB, patch)
2010-10-18 17:11 UTC, Morten Welinder
none Details | Review
Life cycle patch (1.16 KB, patch)
2010-10-19 02:02 UTC, Morten Welinder
committed Details | Review
Updated patch (111.36 KB, patch)
2010-10-19 14:40 UTC, Morten Welinder
none Details | Review
Updated patch (87.04 KB, patch)
2010-10-19 18:56 UTC, Morten Welinder
none Details | Review

Description Morten Welinder 2010-10-08 22:53:34 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.
Comment 1 Morten Welinder 2010-10-08 22:55:07 UTC
Jean: you did this for goffice.  What's involved in doing it?
Comment 2 Jean Bréfort 2010-10-09 07:41:01 UTC
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).
Comment 3 Jean Bréfort 2010-10-09 08:08:13 UTC
I'll do the file conversion during the week-end. Seems that some have duplicate Ids.
Comment 4 Jean Bréfort 2010-10-09 08:25:56 UTC
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).
Comment 5 Jean Bréfort 2010-10-09 08:56:54 UTC
Would it be wise to do these changes in 1.10? I fear that we'll introduce some new bugs.
Comment 6 Morten Welinder 2010-10-09 13:19:59 UTC
Since it is clearly not a mechanical process and not 1-to-1 I think
we might want to wait for branching.
Comment 7 Jean Bréfort 2010-10-09 15:02:49 UTC
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.
Comment 8 Morten Welinder 2010-10-09 16:29:19 UTC
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.
Comment 9 Jean Bréfort 2010-10-09 16:38:00 UTC
Not sure since I also dropped state->gui.
Comment 10 Jean Bréfort 2010-10-09 19:04:52 UTC
Just converted all .glade files. Might be time to not change them anymore.
Comment 11 Jean Bréfort 2010-10-10 06:30:18 UTC
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.
Comment 12 Jean Bréfort 2010-10-17 13:28:38 UTC
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.
Comment 13 Morten Welinder 2010-10-18 16:05:32 UTC
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.
Comment 14 Morten Welinder 2010-10-18 16:49:40 UTC
Done.  Now updating patch.
Comment 15 Morten Welinder 2010-10-18 17:11:09 UTC
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".
Comment 16 Morten Welinder 2010-10-19 02:02:36 UTC
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.
Comment 17 Jean Bréfort 2010-10-19 08:20:41 UTC
Review of attachment 172666 [details] [review]:

Looks good.
Comment 18 Jean Bréfort 2010-10-19 12:52:59 UTC
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.
Comment 19 Morten Welinder 2010-10-19 13:10:35 UTC
It's more or a "can be called several times" than "will be".
Comment 20 Morten Welinder 2010-10-19 14:40:05 UTC
Created attachment 172728 [details] [review]
Updated patch

We're down to 114k (from original 412k).
Comment 21 Morten Welinder 2010-10-19 18:56:11 UTC
Created attachment 172752 [details] [review]
Updated patch

87k...
Comment 22 Morten Welinder 2010-10-19 19:15:49 UTC
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