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 562016 - Migrate from libglade to GtkBuilder
Migrate from libglade to GtkBuilder
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: general
HEAD
Other All
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks: 572883
 
 
Reported: 2008-11-23 15:54 UTC by Luca Ferretti
Modified: 2009-05-19 01:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
code changes (136.46 KB, patch)
2009-04-28 09:45 UTC, Jonathan Matthew
committed Details | Review
gtkbuilder files (26.90 KB, application/x-compressed-tar)
2009-04-28 09:48 UTC, Jonathan Matthew
  Details

Description Luca Ferretti 2008-11-23 15:54:48 UTC
As per http://live.gnome.org/GnomeGoals/RemoveLibGladeUseGtkBuilder could be good move from libglade to GtkBuilder for user interface descriptions.

Plase note that GtkBuilder is well supported in GTK+, but we are still lacking good support in UI Designer (Glade3). See previous page for info.

Rhythmbox currently depends on GTK >= 2.8 so switch to 2.12 (requided by GtkBuilder) could appear a long jump, but please note that Rhythmbox aslo depends on totem-pl-parser 2.22, so it yet needs recent library.

Also, could be good remove deprecated stuff between Gtk 2.8 and 2.12 (if any).
Comment 1 Jonathan Matthew 2009-01-02 11:15:33 UTC
Rhythmbox now requires gtk >= 2.12, and it looks like glade3 has enough support for GtkBuilder at least for a direct conversion of the existing glade files to GtkBuilder format.
Comment 2 Luca Ferretti 2009-01-02 21:21:48 UTC
I've started to play with this here[1].

Not so much by now, just added lib/rb-ui-helper.[ch] to define helper functions for GtkBuild and other small UI stuff (like alerts). By now functions here are just a copy-and-paste from totem-interface - and I didn't tested if it compiles :-).

Now I'm going to test how this approach works against podcast-feed-properties.

[1] http://bzr-playground.gnome.org/~lferrett/rhythmbox/gtkbuilder/files
Comment 3 Jonathan Matthew 2009-04-28 09:45:58 UTC
Created attachment 133476 [details] [review]
code changes

The full patch (removing .glade files, adding .ui files) was over 1MB, so this is just the code changes.  I haven't tested extensively, but everything seems to work OK.
Comment 4 Jonathan Matthew 2009-04-28 09:48:24 UTC
Created attachment 133477 [details]
gtkbuilder files

Converted GtkBuilder files.  I've removed the containing GtkWindow and GtkDialog widgets in the cases where we embed the built UI in an existing window.
Comment 5 Jonathan Matthew 2009-04-28 09:50:05 UTC
I'm probably going to commit this soon.  I think I've checked that all of the UI we build from these files at least appears correctly, but I haven't done much more than that.  More testing is welcome.
Comment 6 Luca Ferretti 2009-05-11 08:18:22 UTC
(In reply to comment #5)
> I'm probably going to commit this soon.  I think I've checked that all of the
> UI we build from these files at least appears correctly, but I haven't done
> much more than that.  More testing is welcome.
> 

Unfortunately I can't do it (by now my only PC is a Dell Mini...) but I can spread this bug. BTW, did you announced this patch on mailing list?

Oh, libglade is now officially deprecated;
http://mail.gnome.org/archives/devel-announce-list/2009-May/msg00003.html
Comment 7 Luca Ferretti 2009-05-11 08:26:46 UTC
(In reply to comment #3)
> Created an attachment (id=133476) [edit]
> code changes
> 
> The full patch (removing .glade files, adding .ui files) was over 1MB, so this
> is just the code changes.  I haven't tested extensively, but everything seems
> to work OK.
> 

Just a note; other projects using GtkBuilder are using something like this:
  
  [type: gettext/glade]data/fullscreen.ui

in POTFILES.in (see http://git.gnome.org/cgit/totem/tree/po/POTFILES.in )

I don't know if it's needed, but could be useful investigate it.


Comment 8 Jonathan Matthew 2009-05-11 11:46:59 UTC
(In reply to comment #6)
> 
> Unfortunately I can't do it (by now my only PC is a Dell Mini...) but I can
> spread this bug. BTW, did you announced this patch on mailing list?

I'm pretty sure I did.  I don't seem to get much response when I do that, though.

> Just a note; other projects using GtkBuilder are using something like this:
> 
>   [type: gettext/glade]data/fullscreen.ui
> 
> in POTFILES.in (see http://git.gnome.org/cgit/totem/tree/po/POTFILES.in )

Thanks for mentioning that.  I hadn't looked into how this affected translations, but it wouldn't surprise me to find we needed to do that sort of thing.

I'm probably going to wait until the multiple library location work is done (bug 523162) before I commit this.  Shouldn't be too long..
Comment 9 Luca Ferretti 2009-05-11 12:24:10 UTC
(In reply to comment #8)
> 
> I'm pretty sure I did.  I don't seem to get much response when I do that,
> though.
> 

Forgot to mention: now that gnome.org switched to git, could be better provide this for testing as a branch, rather then a separate patch to apply.

Not sure about this, but you can delete once merged. See http://www.mail-archive.com/desktop-devel-list@gnome.org/msg15853.html
Comment 10 Bastien Nocera 2009-05-11 13:03:14 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > 
> > I'm pretty sure I did.  I don't seem to get much response when I do that,
> > though.
> > 
> 
> Forgot to mention: now that gnome.org switched to git, could be better provide
> this for testing as a branch, rather then a separate patch to apply.
> 
> Not sure about this, but you can delete once merged. See
> http://www.mail-archive.com/desktop-devel-list@gnome.org/msg15853.html

I don't really see the point when you could be creating a private branch for yourself, and rebase your patch as needed.
Comment 11 Luca Ferretti 2009-05-12 18:04:25 UTC
(In reply to comment #10)
> 
> I don't really see the point when you could be creating a private branch for
> yourself, and rebase your patch as needed.
> 

I was sure the git migration was also to increase productivity, allowing developers to _publish_ test branches with large code changes like this.
Comment 12 Jonathan Matthew 2009-05-18 10:13:41 UTC
I updated the code to include the new status icon plugin, lowered the gtk version requirements in the gtkbuilder files to 2.12, and committed it all.

I haven't figured out how (if?) I want to publish feature branches.  I've got a few local branches that it might make sense to publish, so maybe I'll think about it when I next revisit them.
Comment 13 Luca Ferretti 2009-05-18 11:08:26 UTC
(In reply to comment #12)
> I updated the code to include the new status icon plugin, lowered the gtk
> version requirements in the gtkbuilder files to 2.12, and committed it all.
> 

Matthew, looking at update PO file after this commit, there are some messages that could be "merged" in Magnatune plugin. Take a look at payments in magnatune-prefs.ui and in magnatune-purchase.ui.h

An excerpt from ther first:
  <row>
        <col id="0" translatable="yes">$5 US</col>
      </row>
      <row>
        <col id="0" translatable="yes">$6 US</col>
      </row>
      <row>
        <col id="0" translatable="yes">$7 US</col>
      </row>
      <row>
        <col id="0" translatable="yes">$8 US (typical)</col>
      </row>
      <row>
        <col id="0" translatable="yes">$9 US</col>

Another excerpt from the latter
   <data>
      <row>
        <col id="0" translatable="yes">$5</col>
      </row>
      <row>
        <col id="0" translatable="yes">$6</col>
      </row>
      <row>
        <col id="0" translatable="yes">$7</col>
      </row>
      <row>
        <col id="0" translatable="yes">$8 (typical)</col>
      </row>
      <row>
        <col id="0" translatable="yes">$9</col>


The US is missing, plus, but not showed in this excerpts, some additional labels ("very generous" vs "VERY generous!") are different too.

A similar difference exists for months (only numbers vs month name plus number in parenthesis).

Should I've to open other bug?
Comment 14 Jonathan Matthew 2009-05-18 11:24:38 UTC
Interesting.. these were formerly translated as single messages containing all the amounts and months.  I didn't think to check what happened to them.

I've updated them to make the strings all the same.  Thanks for noticing this.
Comment 15 Luca Ferretti 2009-05-18 20:06:43 UTC
Another change from migration that seems unnecessary

#: ../plugins/jamendo/jamendo-loading.ui.h:11
#, fuzzy
#| msgid ""
#| "Jamendo users can discover and share albums, but also review them or "
#| "start a discussion on the forums.\n"
#| "Albums are democratically rated based on the visitors’ reviews.\n"
#| "If they fancy an artist they can support him by making a donation."
msgid ""
"Jamendo users can discover and share albums, but also review them or start a "
"discussion on the forums.\n"
"Albums are democratically rated based on the visitors&#x2019; reviews.\n"
"If they fancy an artist they can support him by making a donation."

the apostrophe in "visitors'" was changed to &#x2019; entity. Not a big issue, but it marks as fuzzy a string.
Comment 16 Jonathan Matthew 2009-05-19 01:59:21 UTC
That's actually the same character it was before.  I could change it back, but I guess glade would just convert it into an entity again next time someone edited the file.