Feeling yourself disintegrate

life: In the past 24 hours I’ve had:

  • a bad cold
  • a sore throat
  • some lines of fever
  • water spilled on my laptop’s keyboard
  • thus, a broken Ctrl key that would not disengage itself
  • and, finally, a broken Ctrl key that would not work anymore

The last problem was solved by switching Caps Lock and Ctrl (thanks to the Gnome keyboard capplet; but I’d prefer to be able to use the windows key as a replacement, as it’s nearer to the original key), as my finger memory could not adapt to using the right Ctrl key for stuff like workspace navigation.

doap: like all the cool kids, I’m too working on a way for handling DOAP streams, except that I’m doing it in Perl and not in fancy Python (I’m using the Redland library, though). Unfortunately, there’s no such Perl module for basic handling FOAF and DOAP data – so I’ll need to create them first, then work on a nice authoring interface.

perl: also, I’ve been working on Perl bindings for the Maemo libraries, as one of the goals for the 2.0 version of the platform is having language bindings working. From inside the scratchbox (version 0.9.8.5 comes with perl 5.8.4), I downloaded the GLib and Gtk2 modules from CPAN, and even with some failures, they basically worked out of the box; then I began binding stuff (hildon-lgpl, hildon-libs and hildon-fm for starters, libosso will be next, as it needs the DBus perl bindings), and in less than twenty minutes I had my own nice little hello world application written (sorry, no screenshot at the moment).

Now Listening: Led Zeppelin, Stairway to heaven

For the price of a cup of tea

Here’s a screenshot of testaction test showing the GtkRecentAction action for use with the GtkUIManager. The action is bound to a menuitem tag inside the UI definition markup.

GtkRecentAction test

The code needs cleaning up and the hooking up of the GtkRecentChooser interface virtual methods, but it’s not a big issue; setting all the recent chooser knobs using the recent chooser API is not the most beautiful approach I could come up with, though. But so is setting all the properties using specially crafted functions.

The next issue is inlining the list inside a menu (to make the Gedit maintainers happy ;-)). The current (and soon to be deprecated) EggRecent code used the awful EggRecentViewGtk object and its evil spawn (EggRecentViewUIManager and the most devilish EggRecentViewBonobo). The GtkRecent approach “get the list from the recent manager and build the menu items” works for hand-built menus, but for menus created using the UI manager there’s no real option, as there’s no way to create a list of items from a GtkAction. One way to implement it might be adding a GList * (*create_menu_items) (GtkAction *action); virtual method inside GtkActionClass.

Update 2006-04-18@03:51: the tracking bug with my initial draft for the GtkRecentAction is #338843

Now listening: Belle and Sebastian, The Life Pursuit

ChangeLog

moving out: Marta has been in London a couple of times, in these two weeks; she has found a nice house in Crystal Palace, and began to buy furniture and stuff, and preparing it for us to move in. Next week, we’re both going to London and buy the remaining stuff (a sofa-bed, a table for the living room and some chairs to begin with). We should return in Milan for a couple of days on the 4th of May, as we must sign documents and papers for the marriage, and actually choose its date (it’ll be in July, probably).

gtk+ recent: the merge went well; on the gtk-devel list, Murray Cumming pointed out a couple of issues; most notably, the lack of integration with the GtkUIManager. The plan was to add a placeholder tag to the markup used to build the UI, but I really don’t like this approach anymore: it’s inherently messy. As a replacement, I coded up in a couple of hours a new GtkAction subclass: GtkRecentAction; when bound to a menu item tag, it creates a new submenu hooked to a GtkRecentChooserMenu; when bound to a toolbar item tag, it creates a GtkMenuToolButton like the one Gedit uses for the Open toolbar button. Unfortunately, I still can’t see a way to hook up an inlined list of menu items. Well, I suppose I’ll have to file a bug to the HIG and have it changed to use submenus for the list of recently used files. ;-)

gnome-utils: good news everyone: I’ve asked Fabio Marzocca for his permission to include into the gnome-utils package the fine disk usage tool called Baobab that he wrote; he agreed, and work is underway to clean up the code and hook it up to the gnome-utils build, in order to have it ready for the 2.15.1 release. Also, work is underway to add Solaris support to the system log viewer, and I’m fixing up a bunch of open bugs for the dictionary, including the re-addition of the “speller tool” (the list of matching words showed if no definitions were to be found).

Lazy loading

Little post about a useful design pattern in GLib and GTK, written down after a question on the + channel

While I’m not Philip and I won’t go as far as talking about this in public, I wrote down a simple design pattern for lazy loading stuff from a list into a GtkTreeView without blocking your interface or using threads.

Lazy loading using the main loop.

The API has landed

The GtkRecent code is finally in gtk+ HEAD branch.

A couple of things are still missing, mostly documentation and examples (the exact list is here, if you want to check).

The code needed a year to take shape (I was beginning to mull over it a bit too much), but it is cleaner, more efficient and works better than the EggRecent code, that has been copied and pasted all around the world.

The heroes of this tale are undoubtedly: James Willcox, for writing the original code (even if he didn’t reply to my email about its state bad boy, bad boy); Federico Mena-Quintero, for listening to me while we were waiting at a terrible restourant in Stuttgart, and for saying: Go ahead, implement it, and everyone will love you!; Matthias Clasen (still no blog, Matthias?), for helping and suggesting and asking and for maintaining the Best. Toolkit. Ever.

This work is dedicated to my soon-to-be wife, Marta, and for the patience she had while I hacked till the wee hours of the morning. I love you.

And this is just the beginning… I sense bug reports coming…

Merger

Seems that I’m being syndacated… aggregated… whatever… on a Planet, so hi!

I’m starting merging the GBookmarkFile parser into my local copy of GLib’s HEAD branch (the tracker bug is #327662). I’ve created a testb suite and a bunch of invalid and valid bookmark files, in order to test it – and they actually helped me find a couple of stupid regressions that I had introduced.

Pending review of the patch by Matthias, the code should go in GLib first thing next week; once GBookmarkFile is in, the recent manager and the related widgets are due to go in the following days. Right now, I’m writing a patch for GTK’s HEAD branch – stay tuned for a tracker bug about it. Update 2006-03-27@00:31: bug #336121.

Whoa, just a couple weeks shy on a year since I began writing the Perl bindings for the egg-recent code – which is the reason that forced me to open that can of worms and where all the recent files rewrite really began. Never thought that it would take this long, or that it would take me this far. Well, actually I never really thought I had some chances of actually contributing something to the platform libraries at all.

Now listening: Burning down the house, Talking Heads

ChangeLog

Long time, no blog.

Here’s a brief recap of what happened in the last three weeks:

  • Matthias Clasen has began reviewing the Recent Documents code, and we are planning to get it merged beginning next week; I sent a recap to the gtk-devel mailing list, and I’ll send the draft for the Desktop Bookmark specification on the xdg mailing list at fd.o (like I did a year ago, but now I have a working implementation);
  • GNOME 2.14 is out!
  • gnome-utils 2.14.0 is out too!
  • Me and Marta went to London, last week: she went to look the premises of the London School of Economics, as she’ll be taking a MSc there starting from September; me, I met with Matthew Allum, and following the arrengements we made at FOSDEM last Februrary, I signed a contract for working with the great guys at OpenedHand.
  • And last, but not least (or I would be in trouble), I’m getting married!

Gnome-utils 2.13.95 – “Escape Velocity”

Seems like I forgot to announce the new release of gnome-utils; actually, this week-end I had a bad cold (I’m not completely cured, though), and standing in front of my laptop made my eyes sore after two or three minutes.

Anyway, the last release before March 15th is out. It should have been 2.13.94 (and it’s advertised as such inside the README and the NEWS files of the tarball, but who reads those files anyway?), but there has been some misunderstanding between the working copy I checked out from CVS in order to build the release and me. Well, it’s not the first time I fuck up something in the release process – and I’ve got the feeling that it won’t be the last.

The release contains just a couple of last minute fixes, like the handling of the transparency of the applet when the panel is set to a solid color and low opacity; also, the applet’s window can be closed using the Esc key.

Go get it and try it out.

FOSDEM 2006

Next week-end I’ll be in Brussels, at this year’s FOSDEM.

I wasn’t sure whether I’d be able to go or not – late flight booking and I had to check at two hostels before actually getting some place to sleep. I mostly plan to attend the GNOME track, especially Philip‘s talk on design patterns using GObject and Kristian‘s talk on Project Ridley; also, the X.org track and the embedded Linux track promise to be really interesting.

Gnome-utils 2.13.92 – Gnome-utils vs. Bugzilla

This evening, before going to dinner with Marta at my parent’s, I did the 2.13.92 release of gnome-utils, codenamed Gnome-utils versus Bugzilla.

Since we have approached the feature freeze, the UI freeze and now the string freeze, it’s mostly a “fix and clean up” release; a couple of nasty bugs were fixed, though, like the not translatable name of the screenshot file name in the screenshot application, or the dictionary applet’s window flicker when toggled. Also, thanks to Paolo Borelli (and his constant checking out of each commit inside the entire CVS using Bonsai) the log viewer preferences code has been cleaned up a bit, making it more solid and reliable.

Unless new crashers or blocker bugs are found, I think this will be the last release before 2.14.0 hits the tarballs; so, please test it and report any bug you should find as soon as possible, so that we can make Gnome-utils better before the next stable release!