GNOME Bugzilla – Bug 567490
Port to GtkBuilder
Last modified: 2009-02-23 18:24:13 UTC
Seems to work OK (and was surprisingly easy?).
Created attachment 126268 [details] [review] 0001-Use-GtkBuilder-instead-of-Glade.patch
+++ 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.
(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.
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
(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.
(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.
Created attachment 126273 [details] [review] gtkbuilder.diff Diff for prefs-dialog.ui after opening and saving it with glade-3 trunk.
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) $< $@
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(-)
Great, thanks!
BTW, silly question, but is everything but prefs-dialog.glade and epiphany.glade unused or is it just me.
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.
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.