Empathy master ported to GSettings

GLib 2.25.9 just came out, which included a GSettings bugfix I needed, so I’ve just merged the GSettings port branch I wrote for Empathy into master. Unfortunately this does not come with a fancy screenshot. It uses the DConf backend by default, if you do not have DConf, your settings won’t be preserved between instances.

This work includes a .convert file that can be used by gsettings-data-convert to convert from GConf to DConf. I got kinda bored of maintaining this file by hand, so I wrote an XSL script to generate it from the schema XML.

Bugs in GNOME Bugzilla please 🙂

Also, to the Americans and Canadians who enjoy Australian, female folk singers: my favourite band is touring your countries for the next three months (you have to click Next on the page to see every gig). You should go and see them!

Muji: multi-user Jingle

So there were two things I find exciting that got merged in gabble 0.9.12 (gabble is Telepathy’s XMPP/Jabber connection manager). First was support for SASL authentication channels, allowing you handle SASL auth mechanisms from a custom handler (e.g. by not supplying a password to Gabble, or a custom mechanism such as X-GOOGLE-TOKEN or X-FACEBOOK-PLATFORM); thanks to Eitan. Second was multi-user Jingle calls; thanks to Sjoerd.

Muji Demo Client
Muji Demo Client

This is all done as an extension XMPP/Jingle using a XMPP multi-user-chat room (the XEP). The work has not been integrated into Empathy yet, but there is a demo client (yes, it even works from Australia). Sjoerd writes more about it on his new blog.

Meego 1.0 on the Dell Inspiron Mini 1012

While on the topic of Meego, just a quick note for those looking to install on the Dell Inspiron Mini 1012.

Meego itself generally runs quite well on this device, but this machine has a Broadcom BCM4212 wireless chipset (also known as a Dell Wireless 1397) which although supported by the Linux b43 driver is not supported by Meego 1.0. Although Meego 1.0 has a new enough kernel (2.6.33.3), it is unfortunately not a simple case of using the firmware cutting tool to extract the firmware, the module itself is compiled out. This is Meego bug #287.

Your other (non-free) option is to use Broadcom’s STA driver. You’re going to need to yum install make gcc diffutils kernel-netbook-devel to build the module.

Finally if you’re looking to buy a netbook, also know that the trackpad is on this device is pretty frustrating under X due to the buttons being under the touch surface (it’s only slightly less frustrating in Windows 7, to be honest). Collabora X Guru Daniel Stone tells me support for trackpads with buttons under the touch surface is getting better so it’s a lot less annoying jumpy, but it still needs more work. I’ve been using an external mouse.

The Meego 1.0 People Panel

So Meego 1.0 for Netbooks shipped last week. Although I miss that tubby cat, Meego 1.0 is very visually attractive and quite nifty.

One of the really neat things about Meego is how it integrates messaging right into the interface. Unsurprisingly, this messaging is powered by Telepathy, the framework that makes communications into a service that you can use throughout your product. Collabora, with its team of Telepathic Ninjas, helped Intel with some of the Telepathy integration for this release.

Meego 1.0 People Panel
Meego 1.0 People Panel

The People Panel shows your available contacts on the left, and a list of your ongoing conversations on the right. Each conversation lists the number of unread messages.

This integration requires no code in Telepathy, and is all done using a Telepathy Observer (I’ve talked about Observers before). This will work with Empathy, or any other well behaved chat client (as it turned out that Empathy originally wasn’t well behaved, that had to be fixed, those fixes are in Empathy 2.30).

Mission Control allows any application to ensure a communications channel exists, and find an appropriate application to handle that channel. This means that double clicking on a user or ongoing conversation in the People Panel causes Mission Control to signal Empathy (the handler) to bring that conversation to the user’s attention (pop it up) or open a new window if required, even though the People Panel and Empathy are completely separate applications and completely unaware of one another. Again this will work with any well behaved chat client.

This same feature could easily be integrated into GNOME Shell or anywhere else. The code to implement this in Meego is free software.

telepathy-glib GObject-Introspection and TpBaseClient

In Telepathy libraries such as telepathy-glib, telepathy-python and telepathy-qt4 there are two kinds of API. There's what we call low-level API, which is a direct wrapping of the D-Bus API exposed by Telepathy components and automatically generated from the Telepathy specification; and high-level API, which is hand-written and calls the low-level API internally with the goal of making it easier to implement things with Telepathy.

It's relatively easy to expose the low-level API into your language by writing an output module on top of our specparser and using your language's native D-Bus support. However writing a high-level API is a pain in the neck, and requires you to redo a lot of work that's already been done once.

Basically this sucks, so over the last couple of weeks a few of us have been working to support GObject-Introspection for the telepathy-glib high-level API. This means that we can now expose telepathy-glib functionality into languages such as Javascript (via GJS) and Python (via PyGI). We're choosing not to bind the low-level API that telepathy-glib exports, mostly because it's not very pretty and languages have better ways to expose this (N.B. this does create possible ordering problems because you are likely to have two separate DBusConnections). We're also working on extending telepathy-glib to make more things easier.

One such extension is TpBaseClient and its subclass TpSimpleObserver, which are designed to make it significantly easier to write a Telepathy clients such as Observers (TpSimpleHandler is coming soon).

The introspected bindings are not yet production ready, we're still going through and checking everything is annotated correctly, and we've also exposed a few limitations in GJS and PyGI (e.g. GArray support) that don't yet have fixes merged.

Still, putting this all together, it's now possible to write the basis of a Telepathy Observer in Javascript:

const Tp = imports.gi.TelepathyGLib;
const Mainloop = imports.mainloop;

function observe_channels(observer, account, connection, channels,
                          dispatch_op, requests, context, user_data)
{
    print("observe_channels");

    print("account = " + account.get_object_path());
    print("connection = " + connection.get_object_path());

    for (let i in channels) {
        let channel = channels[i];

        print("channel = " + channel.get_object_path());
    }

    if (dispatch_op != null)
      print("dispatch_op = " + dispatch_op.get_object_path());
    else
      print("dispatch_op = (null)");

    for (let i in requests) {
      let request = requests[i];

      print("request = " + request.get_object_path());
    }

    context.accept();
}

let dbus = Tp.DBusDaemon.dup();
let observer = Tp.SimpleObserver.new(dbus, true, "JSObserver", true,
                                     observe_channels);

observer.add_observer_filter({
  "org.freedesktop.Telepathy.Channel.ChannelType": Tp.IFACE_CHANNEL_TYPE_TEXT,
});

try {
    observer.register();
    Mainloop.run("");
} catch (e) {
    print("ERROR: " + e);
}

All of this work is now merged into telepathy-glib master, and will be released as part of the telepathy-glib 0.12.

a Telepathy blinkenlights "plugin"

A request that people occasionally make is that they would like a “blinkenlights” plugin for Empathy, similar to the one for Pidgin. The nice thing about using Telepathy, is that for any case where we simply want to observe the state of a conversation (or file transfer, or video call, etc.), we don't need to write a plugin per chat client, instead we can write what in Telepathy parlance we call an Observer.

An Observer does just that, it observes. The new logging service is an Observer that records all of the messages coming to and from the chat clients. Soon Zeitgeist will observe Telepathy channels to record when you started and finished conversation and VoIP calls for your activity journal (this is really awesome, I'm really looking forward to this). It's possible for an Observer to list currently ongoing conversations (Meego does this) and to count how many unread messages a conversation has (so long as you have a well-behaved client, that only acknowledges messages once it's sure the user has seen them).

And so with that in mind, I present all the Telepathy bits of a blinkenlights Observer. I say all the Telepathy bits, because it doesn't actually do any light blinking, and instead prints out TOTAL UNREAD MESSAGES: 2. Basically I'm hoping that someone else writes the light-blinking bit. If you do that, I'll package this up as a real program, that registers with Mission Control and everything and can be installed to make your lights blink to your heart's content.

For reference, it depends on tp-glib 0.11, cause I like using API I wrote last week. If someone wants to extend this example further (e.g. to listing the name of the sender on your LCD panel on your keyboard), jump on irc.freenode.net/#telepathy and we can help you do that too.

Finally, for the Python-people, here's an example Observer in Python. This Observer doesn't count unread messages (instead it tracks the lifetime of a conversation, like Zeitgeist will do), but it could be easily modified to count unread messages instead.

empathy: the future's gonna be awesome

So we've been doing a bit of work on Empathy lately (but too late for GNOME 2.30 I'm afraid), and trying out some crazy new ideas.

One of these Favourite Contacts. You can now mark contacts in your contact list as favourites, and they will always been shown at the top of your roster (as well as in any groups they're a part of).

Another is Frequent Contacts. This information is generated by the new telepathy-logger service, and shows which of your contacts (on your contact list) message you most frequently.

The telepathy-logger is a new desktop wide logging service in development that applications (such as Zeitgeist) will be able to query to retrieve conversations that take place via Telepathy. As well as recording the actual messages you send and receive it also generates statistics, such as your most frequent contacts. This means information such as your favourite and recent contacts are also available to other Telepathy clients (perhaps they could appear integrated into GNOME Shell along with current conversations).

We're also considering adding Recent Contacts, so you can quickly return to a conversation you have been recently having after you close the window.

tramtracker in maemo extras-devel [plus some crap about Optus]

Finally got a version of tramtracker (a client for tracking Melbourne trams) and python-suds uploaded to Maemo's extras-devel. There are a couple of issues, the known ones relate to this bug.

In my head I was having a race to see which would be done first: Optus sorting out my phone enough so that I could have data on it; or getting my app into the repository. Turns out, even though I didn't make a lot of effort, I still won.

In fairness, I probably could have gone today to get my phone recontracted (since I think it cut over last night), but the guy told me to come back on Saturday. I'm really hoping this is the end of about 4 hours of dealing with Optus over my phone. It started off by me looking at 3G data plans, and realising that if Stephanie and I both recontracted for 12 months, and put our numbers onto the same account, we could pay for both of our phones for the cost of her phone bill. Unfortunately my phone number was still in my Dad's name, and stuck in some antique account keeping system, so had to be migrated forwards (which took forever), then some nonsense about a credit check. [I'm sorry, but you gave the international student who's been here 4 months, and is not even a resident, a $60/month iPhone plan; why do I need to jump through so many hoops when I have a job and only want a $20/month plan where I bring my own damn phone?] Finally though both phones have been moved onto the same account, so I can go and recontract tomorrow (hopefully; I've been saying this for weeks).

That said, while Optus the company have basically been screwing me around. I do have to give kudos to the peoples at Optus Shop Brunswick, who have spent countless hours on the phone to Optus HQ trying to sort this out for me, even though they've so far earned absolutely no commission from me. I had thought about recontracting my phone at whatever store I happened to pass, but I think I should make sure these guys get the commission.

fixing button theming with GtkBuilder

This is a bit icky. It would be neater if the Python bindings exposed hildon_gtk_widget_set_theme_size(), but not much. So, to fix the button theming if you've created your interface with GtkBuilder, it looks something like this:

# these aren't exported anywhere, copied from Maemo GTK+
HILDON_HEIGHT_FINGER = 70
HILDON_HEIGHT_THUMB = 105

# fix theming
for widget in self.ui.get_objects():
    if not isinstance(widget, gtk.Button): continue
    # hildon_gtk_widget_set_theme_size is not bound into Python
    if widget.get_name().startswith('largebutton'):
        widget.set_size_request(-1, HILDON_HEIGHT_THUMB)
    elif widget.get_name().startswith('kpbutton'):
        widget.set_size_request(HILDON_HEIGHT_THUMB, HILDON_HEIGHT_THUMB)
    widget.set_name('HildonButton-thumb')

happy new year

Had a pleasant day off eating snacks, watching The Pretender with friends and hacking on my tram tracking app. I added geolocation, which meant needing to test on the device, so I had to package up python-suds for Maemo (git-buildpackage repo, Maemo package).

The app actually runs quite nicely on the device, although each SOAP query is a little slower than in Scratchbox. This makes the Update Database quite a bit slower (also possibly calling COMMIT after each INSERT is a little expensive, I'm not sure). Otherwise things are quite zippy, including searching by location.

I'm not entirely sure I'm using the location API correctly, I don't seem to receive any updates to the location. I think it does some caching to speed up lookups and cut down on signals, so I'll need to try it from another location, but I don't even seem to receive an initial signal when the GPS locks.

I started having a go at packaging the application itself, but ran into some error I don't understand (Debian always seems to throw obscure errors when I try to package things). Regardless, the branch is here. Would love some help here.

It seems like all the fundamentals are now in place; including favourites, status messages and geolocation. Still want to add support for tracking individual trams. Also need to tweak the interfaces, buttons don't look like they have the right texture. Was thinking of using my Google Maps/GtkWebKit experiments to add a “View On Map” option for location based searches.

Creative Commons Attribution-ShareAlike 2.5 Australia
This work by Danielle Madeley is licensed under a Creative Commons Attribution-ShareAlike 2.5 Australia.