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 581100 - drop libglade dependency
drop libglade dependency
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Control-Center Maintainers
Control-Center Maintainers
Depends on:
Blocks: 572883
 
 
Reported: 2009-05-02 14:27 UTC by Felix Riemann
Modified: 2009-07-30 23:25 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
[PATCH 1/2] Drop libgnome dep from display-properties capplet (34.30 KB, patch)
2009-05-02 14:28 UTC, Felix Riemann
accepted-commit_now Details | Review
[2/2] Strip libglade dep from gnome-window-properties (26.94 KB, patch)
2009-05-02 14:30 UTC, Felix Riemann
needs-work Details | Review
remove libglade from gnome-window-properties second try (28.45 KB, patch)
2009-07-03 22:52 UTC, Felix Riemann
reviewed Details | Review
remove libglade from gnome-display-properties (48.16 KB, patch)
2009-07-07 19:08 UTC, Felix Riemann
committed Details | Review
clean gnome-window-properties (48.68 KB, patch)
2009-07-07 19:16 UTC, Felix Riemann
committed Details | Review
Remove libglade depency from at-properties capplet (42.85 KB, patch)
2009-07-10 12:03 UTC, Felix Riemann
committed Details | Review
Remove libglade dep from default-applications capplet (174.00 KB, patch)
2009-07-10 13:04 UTC, Felix Riemann
committed Details | Review
Remove libglade dependency from keybindings capplet (45.11 KB, patch)
2009-07-10 14:52 UTC, Felix Riemann
committed Details | Review
Remove libglade dependency from gnome-network-properties (139.46 KB, patch)
2009-07-15 20:00 UTC, Felix Riemann
committed Details | Review
Remove libglade dependency from keyboard capplet (30.61 KB, patch)
2009-07-30 01:00 UTC, Robert Ancell
none Details | Review
Remove libglade dependency from keyboard capplet (327.10 KB, patch)
2009-07-30 01:12 UTC, Robert Ancell
none Details | Review
Remove libglade dependency from keyboard capplet (354.33 KB, patch)
2009-07-30 01:27 UTC, Robert Ancell
none Details | Review
Remove libglade dependency from keyboard capplet (358.38 KB, patch)
2009-07-30 01:42 UTC, Robert Ancell
none Details | Review
Remove libglade dependency from about-me capplet (149.84 KB, patch)
2009-07-30 02:42 UTC, Robert Ancell
none Details | Review
Remove libglade dependency from mouse capplet (221.82 KB, patch)
2009-07-30 02:56 UTC, Robert Ancell
none Details | Review
Remove libglade dependency from about-me capplet (192.00 KB, patch)
2009-07-30 03:43 UTC, Robert Ancell
committed Details | Review
Screwed up the patch again (103.17 KB, patch)
2009-07-30 03:43 UTC, Robert Ancell
committed Details | Review
Remove libglade dependency from keyboard capplet (359.35 KB, patch)
2009-07-30 03:44 UTC, Robert Ancell
committed Details | Review
Remove libglade dependency from mouse capplet (222.41 KB, patch)
2009-07-30 03:45 UTC, Robert Ancell
committed Details | Review
Remove Glade from the build system (10.96 KB, patch)
2009-07-30 03:46 UTC, Robert Ancell
committed Details | Review

Description Felix Riemann 2009-05-02 14:27:16 UTC
As you probably know libglade is going to be officially declared deprecated with 2.27.1 in favor of GtkBuilder.

So, to get the conversion started in control-center I converted the display and window preferences capplets to GtkBuilder.
Comment 1 Felix Riemann 2009-05-02 14:28:36 UTC
Created attachment 133806 [details] [review]
[PATCH 1/2] Drop libgnome dep from display-properties capplet

---
 capplets/display/Makefile.am        |    6 +-
 capplets/display/build.sh           |    2 +-
 capplets/display/display-capplet.ui |  531 +++++++++++++++++++++++++++++++++++
 capplets/display/xrandr-capplet.c   |   62 +++--
 4 files changed, 573 insertions(+), 28 deletions(-)
Comment 2 Felix Riemann 2009-05-02 14:30:02 UTC
Created attachment 133807 [details] [review]
[2/2] Strip libglade dep from gnome-window-properties

Glade file converted using Glade-3 this time because of GtkComboBox.
---
 capplets/windows/Makefile.am                |    8 +-
 capplets/windows/gnome-window-properties.c  |   60 +++--
 capplets/windows/gnome-window-properties.ui |  381 +++++++++++++++++++++++++++
 3 files changed, 419 insertions(+), 30 deletions(-)
Comment 3 Claude Paroz 2009-06-03 20:17:56 UTC
Please don't forget to update also po/POTFILES.in with a similar line:
[type: gettext/glade]<path>.ui
Comment 4 Jens Granseuer 2009-07-03 16:51:33 UTC
First off, sorry for being so slow to respond. g-c-c has only just branched, but I hope we can get back up to speed now.

(In reply to comment #2)
> [2/2] Strip libglade dep from gnome-window-properties

In general, indentation is broken (tabs vs. spaces).

-static GtkWidget *focus_mode_checkbutton;
-static GtkWidget *autoraise_checkbutton;
-static GtkWidget *autoraise_delay_slider;
+static GObject *focus_mode_checkbutton;
+static GObject *autoraise_checkbutton;
+static GObject *autoraise_delay_slider;

It seems to me like casting once on _get_object is better than casting any time one of these is actually used.

+	if (gtk_builder_add_from_file (builder, UIDIR "/gnome-window-properties.ui", &error) == 0) {
+                g_warning ("Could not parse UI file: %s", error->message);
+		g_error_free (error);

If we don't look at the error, anyway, don't pass it.
Comment 5 Felix Riemann 2009-07-03 22:52:45 UTC
Created attachment 137813 [details] [review]
remove libglade from gnome-window-properties second try

(In reply to comment #4)
> First off, sorry for being so slow to respond. g-c-c has only just branched,
> but I hope we can get back up to speed now.
> 
No problem. :-)

> (In reply to comment #2)
> > [2/2] Strip libglade dep from gnome-window-properties
> 
> In general, indentation is broken (tabs vs. spaces).
> 

Well, this seems to be pretty inconsistent already in the original code.
Spaces seem to be the desired way (at least in the gnome-window-properties capplet), so I changed my additions to indent using spaces. Didn't fix the other already present "broken" lines as that belongs into a separate patch imho.

> -static GtkWidget *focus_mode_checkbutton;
> -static GtkWidget *autoraise_checkbutton;
> -static GtkWidget *autoraise_delay_slider;
> +static GObject *focus_mode_checkbutton;
> +static GObject *autoraise_checkbutton;
> +static GObject *autoraise_delay_slider;
> 
> It seems to me like casting once on _get_object is better than casting any
> time one of these is actually used.

These are rarely used as GtkWidget rather than as their specific widget type (GtkRange,GtkToolButton,...). I could change the definition to use this as well, but I'm not sure if you'd like that as it looks more uncommon and makes the patch larger.

> +       if (gtk_builder_add_from_file (builder, UIDIR
> "/gnome-window-properties.ui", &error) == 0) {
> +                g_warning ("Could not parse UI file: %s", error->message);
> +               g_error_free (error);
> 
> If we don't look at the error, anyway, don't pass it.
> 

Actually, the error is used in the warning that's logged to the console/log. Or do you mean an error dialog?
Comment 6 Jens Granseuer 2009-07-04 11:06:59 UTC
(In reply to comment #5)
> Created an attachment (id=137813) [edit]
> remove libglade from gnome-window-properties second try

+++ b/po/POTFILES.skip
@@ -14,6 +14,7 @@ capplets/mouse/gnome-settings-mouse.desktop.in
 capplets/network/gnome-network-properties.desktop.in
 capplets/sound/gnome-settings-sound.desktop.in
 capplets/windows/window-properties.desktop.in
+capplets/windows/gnome-window-properties.glade

The glade file is removed from the repo, is it not? Why add it to the skip list then?

> Well, this seems to be pretty inconsistent already in the original code.
> Spaces seem to be the desired way (at least in the gnome-window-properties
> capplet), so I changed my additions to indent using spaces. Didn't fix the
> other already present "broken" lines as that belongs into a separate patch
> imho.

Yes, it's a mess. All we can do is try to not make it any messier...

> These are rarely used as GtkWidget rather than as their specific widget type
> (GtkRange,GtkToolButton,...). I could change the definition to use this as
> well, but I'm not sure if you'd like that as it looks more uncommon and makes
> the patch larger.

Fair enough.

> Actually, the error is used in the warning that's logged to the console/log. 

Right, missed that.
Comment 7 Felix Riemann 2009-07-04 12:33:03 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Created an attachment (id=137813) [edit]
> > remove libglade from gnome-window-properties second try
> 
> +++ b/po/POTFILES.skip
> @@ -14,6 +14,7 @@ capplets/mouse/gnome-settings-mouse.desktop.in
>  capplets/network/gnome-network-properties.desktop.in
>  capplets/sound/gnome-settings-sound.desktop.in
>  capplets/windows/window-properties.desktop.in
> +capplets/windows/gnome-window-properties.glade
> 
> The glade file is removed from the repo, is it not? Why add it to the skip list
> then?
> 

That's because when I first did the patches, I was planning to keep the glade file as backup. But yes, I think we can remove it now, as glade3 seems to work pretty well now. Should be no problem to strip this chunk before applying.

(In reply to comment #1)
> Created an attachment (id=133806) [edit]
> [PATCH 1 [edit]/2] Drop libgnome dep from display-properties capplet

I'll need to enhance this patch a bit (re-convert UI file and one glade_xml -> gtk_builder change) to incorporate the changes Federico did in the meantime.

Comment 8 Felix Riemann 2009-07-07 19:08:58 UTC
Created attachment 137987 [details] [review]
remove libglade from gnome-display-properties

(In reply to comment #7)
> (In reply to comment #1)
> > Created an attachment (id=133806) [edit]
> > [PATCH 1 [edit] [edit]/2] Drop libgnome dep from display-properties capplet
> 
> I'll need to enhance this patch a bit (re-convert UI file and one glade_xml ->
> gtk_builder change) to incorporate the changes Federico did in the meantime.
> 
Did this now.
Comment 9 Felix Riemann 2009-07-07 19:16:13 UTC
Created attachment 137988 [details] [review]
clean gnome-window-properties

Identical to attachment 137813 [details] [review] except that the glade file is removed now.
Comment 10 Jens Granseuer 2009-07-08 18:03:39 UTC
The windows properties patch has broken indentation in main. Please commit after fixing that. Thanks!
Comment 11 Rodrigo Moya 2009-07-09 13:00:45 UTC
Patches committed, with broken indentation fixed
Comment 12 Javier Jardón (IRC: jjardon) 2009-07-09 14:46:56 UTC
I reopen the bug because gnome-control-center still uses libglade library.
See http://www.gnome.org/~fpeters/299.html for a complete list
Comment 13 Felix Riemann 2009-07-10 12:03:08 UTC
Created attachment 138184 [details] [review]
Remove libglade depency from at-properties capplet

This ones also does some optimization: It creates and assigns the GtkImage instances (using stock-images) used by a few of the buttons through GtkBuilder.
Comment 14 Felix Riemann 2009-07-10 13:04:41 UTC
Created attachment 138188 [details] [review]
Remove libglade dep from default-applications capplet
Comment 15 Felix Riemann 2009-07-10 14:52:27 UTC
Created attachment 138195 [details] [review]
Remove libglade dependency from keybindings capplet
Comment 16 Jens Granseuer 2009-07-10 17:25:34 UTC
Created attachment 138184 [details] [review]
Remove libglade depency from at-properties capplet

+		g_warning ("Could not load UI: %s\n", error->message);

g_warning and friends don't need a trailing newline. Otherwise good to go.

Created an attachment (id=138195)
Remove libglade dependency from keybindings capplet

Same here.
Comment 17 Felix Riemann 2009-07-10 17:58:00 UTC
(In reply to comment #16)
> Created an attachment (id=138184) [edit]
> Remove libglade depency from at-properties capplet
> 
> +               g_warning ("Could not load UI: %s\n", error->message);
> 
> g_warning and friends don't need a trailing newline. Otherwise good to go.
> 

Oops, old habit of mine, appending \n to printf-style strings. Deleted them before committing.
Comment 18 Thomas Andersen 2009-07-13 17:04:36 UTC
Status:

find . -name *.glade
./capplets/keyboard/gnome-keyboard-properties.glade
./capplets/about-me/gnome-about-me.glade
./capplets/about-me/gnome-about-me-fingerprint.glade
./capplets/network/gnome-network-properties.glade
./capplets/mouse/gnome-mouse-properties.glade
./capplets/localization/localization.glade

grep -rn '#include <glade' *
capplets/keyboard/gnome-keyboard-properties.c:32:#include <glade/glade.h>
capplets/keyboard/gnome-keyboard-properties-xkb.c:31:#include <glade/glade.h>
capplets/keyboard/gnome-keyboard-properties-xkbpv.c:28:#include <glade/glade.h>
capplets/keyboard/gnome-keyboard-properties-xkbltadd.c:30:#include <glade/glade.h>
capplets/keyboard/gnome-keyboard-properties-xkbmc.c:30:#include <glade/glade.h>
capplets/keyboard/gnome-keyboard-properties-xkbot.c:32:#include <glade/glade.h>
capplets/keyboard/gnome-keyboard-properties-a11y.h:29:#include <glade/glade.h>
capplets/keyboard/gnome-keyboard-properties-xkblt.c:29:#include <glade/glade.h>
capplets/about-me/gnome-about-me-fingerprint.h:20:#include <glade/glade.h>
capplets/about-me/gnome-about-me-password.c:34:#include <glade/glade.h>
capplets/about-me/gnome-about-me.c:30:#include <glade/glade.h>
capplets/about-me/gnome-about-me-fingerprint.c:22:#include <glade/glade.h>
capplets/network/gnome-network-properties.c:29:#include <glade/glade.h>
capplets/mouse/gnome-mouse-accessibility.c:19:#include <glade/glade.h>
capplets/mouse/gnome-mouse-accessibility.h:21:#include <glade/glade.h>
capplets/mouse/gnome-mouse-properties.c:31:#include <glade/glade.h>
capplets/localization/main.c:23:#include <glade/glade-xml.h>
Comment 19 Felix Riemann 2009-07-15 20:00:30 UTC
Created attachment 138472 [details] [review]
Remove libglade dependency from gnome-network-properties

(In reply to comment #18)
> Status:
> ./capplets/localization/localization.glade
> ...
> capplets/localization/main.c:23:#include <glade/glade-xml.h>
> 

So, what about this one. It doesn't seem to be built. Deprecated? Removable?
Comment 20 Rodrigo Moya 2009-07-16 09:55:14 UTC
localization capplet is almost empty, so just forget about it for now, unless you want to change it. But it's not used at all, since it was started but never did anything useful. We might want to have it for future releases, so I guess, if you have time, it would be good to just change it to GtkBuilder and have someone work on it for next cycle
Comment 21 Robert Ancell 2009-07-30 01:00:58 UTC
Created attachment 139513 [details] [review]
Remove libglade dependency from keyboard capplet

Conservative patch, splits the existing .glade file into multiple .ui files and overides the WID() macro
Comment 22 Robert Ancell 2009-07-30 01:12:13 UTC
Created attachment 139514 [details] [review]
Remove libglade dependency from keyboard capplet

Previous patch generated incorrectly
Comment 23 Robert Ancell 2009-07-30 01:27:30 UTC
Created attachment 139517 [details] [review]
Remove libglade dependency from keyboard capplet

Had wrong name for a11y notifications .ui file
Comment 24 Robert Ancell 2009-07-30 01:42:43 UTC
Created attachment 139518 [details] [review]
Remove libglade dependency from keyboard capplet

I hate git so much...
Comment 25 Robert Ancell 2009-07-30 02:42:36 UTC
Created attachment 139522 [details] [review]
Remove libglade dependency from about-me capplet
Comment 26 Robert Ancell 2009-07-30 02:56:58 UTC
Created attachment 139523 [details] [review]
Remove libglade dependency from mouse capplet
Comment 27 Robert Ancell 2009-07-30 03:43:13 UTC
Created attachment 139526 [details] [review]
Remove libglade dependency from about-me capplet
Comment 28 Robert Ancell 2009-07-30 03:43:52 UTC
Created attachment 139527 [details] [review]
Screwed up the patch again
Comment 29 Robert Ancell 2009-07-30 03:44:22 UTC
Created attachment 139528 [details] [review]
Remove libglade dependency from keyboard capplet
Comment 30 Robert Ancell 2009-07-30 03:45:04 UTC
Created attachment 139529 [details] [review]
Remove libglade dependency from mouse capplet
Comment 31 Robert Ancell 2009-07-30 03:46:08 UTC
Created attachment 139530 [details] [review]
Remove Glade from the build system

Assumes the localization code is to be removed.  Also fixes the previous patches not putting the MIME prefix on po/POTFILES.in
Comment 32 Robert Ancell 2009-07-30 03:47:05 UTC
Sorry for all the noise - I have an ongoing battle with git...

Anyway the patches should remove all libglade from GNOME Control centre.
Comment 33 Rodrigo Moya 2009-07-30 09:43:54 UTC
Please commit them all!
Comment 34 Robert Ancell 2009-07-30 23:25:59 UTC
All committed, I also changed localization to GtkBuilder.  No more Glade!