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 567490 - Port to GtkBuilder
Port to GtkBuilder
Status: RESOLVED FIXED
Product: epiphany
Classification: Core
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: Epiphany Maintainers
Epiphany Maintainers
Depends on:
Blocks: 572883
 
 
Reported: 2009-01-12 13:09 UTC by Xan Lopez
Modified: 2009-02-23 18:24 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-Use-GtkBuilder-instead-of-Glade.patch (456.94 KB, patch)
2009-01-12 13:10 UTC, Xan Lopez
none Details | Review
gtkbuilder.diff (117.71 KB, patch)
2009-01-12 13:44 UTC, Xan Lopez
none Details | Review
[1/1] Port to use GtkBuilder. (6.14 KB, patch)
2009-01-12 15:00 UTC, Xan Lopez
committed Details | Review

Description Xan Lopez 2009-01-12 13:09:41 UTC
Seems to work OK (and was surprisingly easy?).
Comment 1 Xan Lopez 2009-01-12 13:10:36 UTC
Created attachment 126268 [details] [review]
0001-Use-GtkBuilder-instead-of-Glade.patch
Comment 2 Christian Persch 2009-01-12 13:17:46 UTC
+++ b/data/gtkbuilder/Makefile.in

This file doesn't belong in SVN.

From POTFILES.in:

+data/gtkbuilder/certificate-dialogs.ui
+data/gtkbuilder/epiphany.ui
+data/gtkbuilder/form-signing-dialog.ui
+data/gtkbuilder/prefs-dialog.ui
+data/gtkbuilder/print.ui

IIRC you need to prefix these with [type: gettext/glade] to get intltool to correctly read them.

I assume you converted the glade files with gtk-builder-convert? Have you verified that a load-save cycle with glade-3 svn works (ie. doesn't introduce nontrivial changes)? We need to keep these files editable, so if glade-3 can't work them, we'd need to use gtk-builder-convert at build time and keep the glade files for now.
Comment 3 Xan Lopez 2009-01-12 13:27:08 UTC
(In reply to comment #2)
> +++ b/data/gtkbuilder/Makefile.in
> 
> This file doesn't belong in SVN.
> 
> From POTFILES.in:
> 

Oops, git add * 0:)

> +data/gtkbuilder/certificate-dialogs.ui
> +data/gtkbuilder/epiphany.ui
> +data/gtkbuilder/form-signing-dialog.ui
> +data/gtkbuilder/prefs-dialog.ui
> +data/gtkbuilder/print.ui
> 
> IIRC you need to prefix these with [type: gettext/glade] to get intltool to
> correctly read them.

You mean literally like that in the Makefile.am?

> 
> I assume you converted the glade files with gtk-builder-convert? Have you
> verified that a load-save cycle with glade-3 svn works (ie. doesn't introduce
> nontrivial changes)? We need to keep these files editable, so if glade-3 can't
> work them, we'd need to use gtk-builder-convert at build time and keep the
> glade files for now.
> 

Actually I think there is no released glade-3 that can deal with GtkBuilder, but I can try with trunk.
Comment 4 Xan Lopez 2009-01-12 13:29:55 UTC
Yeah, you are right about [type: gettext/glade]. One example: http://www.gnu-darwin.org/www001/ports-1.5a-CURRENT/multimedia/totem/work/totem-2.20.1/po/POTFILES.in
Comment 5 Christian Persch 2009-01-12 13:31:06 UTC
(In reply to comment #3)
> > +data/gtkbuilder/certificate-dialogs.ui
> > +data/gtkbuilder/epiphany.ui
> > +data/gtkbuilder/form-signing-dialog.ui
> > +data/gtkbuilder/prefs-dialog.ui
> > +data/gtkbuilder/print.ui
> > 
> > IIRC you need to prefix these with [type: gettext/glade] to get intltool to
> > correctly read them.
> 
> You mean literally like that in the Makefile.am?

This is in POTFILES.in, not Makefile.am. And yes, just put that literally on the start of each of these lines.

> > I assume you converted the glade files with gtk-builder-convert? Have you
> > verified that a load-save cycle with glade-3 svn works (ie. doesn't introduce
> > nontrivial changes)? We need to keep these files editable, so if glade-3 can't
> > work them, we'd need to use gtk-builder-convert at build time and keep the
> > glade files for now.
> > 
> 
> Actually I think there is no released glade-3 that can deal with GtkBuilder,
> but I can try with trunk.

I meant glade-3 svn trunk, yes. If there's a diff, can you post it here, so I can see if it's ok.
Comment 6 Xan Lopez 2009-01-12 13:43:26 UTC
(In reply to comment #5)
> > Actually I think there is no released glade-3 that can deal with GtkBuilder,
> > but I can try with trunk.
> 
> I meant glade-3 svn trunk, yes. If there's a diff, can you post it here, so I
> can see if it's ok.
> 

It seems to change lots of things. Some of the changes look just wrong to me, and ephy crashes with the new file. Diff for prefs-dialog.ui attached.

Comment 7 Xan Lopez 2009-01-12 13:44:11 UTC
Created attachment 126273 [details] [review]
gtkbuilder.diff

Diff for prefs-dialog.ui after opening and saving it with glade-3 trunk.
Comment 8 Christian Persch 2009-01-12 13:49:49 UTC
Just as I feared, glade-3 still isn't usable yet :(

So let's do what I did in gnome-terminal: keep the .glade files as the master files for editing, and create the gtkbuilder .ui files at build time:

configure.ac fragment:

AC_PATH_PROG([GTK_BUILDER_CONVERT],[gtk-builder-convert],[false])
if test "$GTK_BUILDER_CONVERT" = "false"; then
  AC_MSG_ERROR([gtk-builder-convert not found])
fi


Makefile.am fragment:

%.ui: %.glade
        $(GTK_BUILDER_CONVERT) $< $@
Comment 9 Xan Lopez 2009-01-12 15:00:16 UTC
Created attachment 126282 [details] [review]
[1/1] Port to use GtkBuilder.


Bug #567490

We keep the old glade files as master source and convert them to
GtkBuilder format at compile-time because glade-3 is not ready yet for
day-to-day edition of GtkBuilder files.
---
 configure.ac               |   13 ++++++++++---
 data/glade/Makefile.am     |    8 +++++++-
 embed/downloader-view.c    |    2 +-
 lib/ephy-dialog.c          |   25 ++++++++++++++++---------
 src/ephy-encoding-dialog.c |    2 +-
 src/pdm-dialog.c           |    2 +-
 src/prefs-dialog.c         |    4 ++--
 7 files changed, 38 insertions(+), 18 deletions(-)
Comment 10 Christian Persch 2009-01-12 15:20:40 UTC
Great, thanks!
Comment 11 Xan Lopez 2009-01-12 15:26:40 UTC
BTW, silly question, but is everything but prefs-dialog.glade and epiphany.glade unused or is it just me.
Comment 12 Christian Persch 2009-01-12 16:51:16 UTC
Yes, they were used in the mozilla backend's security dialogues. Unless you think we will re-implement this for webkit soon, they should be svn removed.
Comment 13 Xan Lopez 2009-01-13 15:11:05 UTC
Well, not sure if it will be "soon", but certainly we'll get to that eventually... I'm leaving there for now so they serve as a remainder of what's missing.