Updates on GNOME Calculator

GtkBuilder templates

Last GUADEC Michael Catanzaro asked for help out loud trying to find a new maintainer and I decided to take the bullet. For a couple of months I felt a bit guilty since I was merely doing new tarballs containing pretty much just translations.

However at some point a couple of months ago I sat down and started reviewing patches people were submitting and got up to speed with the current state in bugzilla, the review process allowed me to get familiar enough with the codebase to start finding things I would enjoy doing.

The biggest task I’ve been trying to accomplish is to move all the UI code to GtkBuilder .ui files and rework the codebase to use them as reusable templates. Vala has great support for this, here’s an example on how to create a MathWindow class, with a widget as a private member and a callback:


[GtkTemplate (ui = "/org/gnome/calculator/math-window.ui")]
public class MathWindow : Gtk.ApplicationWindow
{
[GtkChild]
private Gtk.MenuButton menu_button;
[GtkCallback]
private void scroll_changed_cb (Gtk.Adjustment adjustment)
{
return;
}
}

This has allowed me to remove quite a few lines of code making the project a bit more maintainable. It has been also a good opportunity to get familiar with gresource

DX Hackfest & XDG App

During the DX hackfest I spent some time to package GNOME Calculator as an XDG App, the only problem the app had was that it was using gvfs to retrieve currency data from the network. I ported this to ye’olde libsoup and everything went on smoothly. On the third day I caught a bad case of food poisoning so on the last day of the hackfest I was rather useless.

I would like to thank Philip Withnall for organizing the hackfest, Javier Hernandez for hosting me in his couch, our friends from the Betacowork space in Brussels for coping yet another year with the GNOME and LibreOffice hackers, and the GNOME Foundation as well as many other companies for sponsoring people to attend.

3 thoughts on “Updates on GNOME Calculator

  1. “Take the bullet,” you seemed interested in it to me 🙂

    Thanks for helping; I need to, like Sebastian, refocus.

    Vala’s UI templates are awesome. 🙂

    Liked by 1 person

Leave a comment