Wednesday, June 30, 2010

Signatures

My workplace is tied to environment protection and such and I've been wondering now for a while now, how much resources are wasted on processing e-mail signatures? We have a policy to have all kinds of crap in the signature, about 25-30 lines... sigh, fortunately nobdy enforces it so my signature is a whopping 2 lines, but I digress.
Anyway, many thousands (millions?) of servers need to process e-mail all the time, checking for spam and filter to folders and so on. So if the body of the mail is 1-2 lines and the rest is just baggage, how much energy is now wasted just to move the useless signature around ? One e-mail may not be much, but when you think about how much e-mail is transferred all the time and going to many routers and servers. It must add up to quite a lot don't you think?

Thursday, June 24, 2010

The problem with maemo (and meego in a way too)

I've been a happy user of both the original Nokia 770 tablet, the N810 and N900. From the point of view of a normal user I've been very happy with all of them, they have done what they promised and as a user I don't have that much to complain about. But..

As a developer I was drawn to the original tables as it was gobject/gtk+/gnome based with no bloat of C++ or some java stuff.
Made it easy to create software and somewhat easy to support both desktop and tablets in the same software, with some ifdeffing for maemo specific parts (gtk/hildon). That was more or less working in 2007-2008, but currently it's a blody mess.
Trying to support Gregale, Diablo, Fremantle and normal desktop gnome in the same app is these days such a pain that I've almost lost interest to do anything at all (one reason for Mapper developing at a snail pace currently).
Even Fremantle, that should use the latest technologies, (and Diablo) is stuck in the stone ages, gtk is in the 2.10 series (3-4 yeras old) Gregale is even worse with 2.6. Same with glib. Then we have gnome-vfs and gio mess.
And tablets specific Hildon changes, 3 almost compatible versions. Then we have 3-4 different UI styles to support.

And now upstream gtk+ is moving to version 3.0 and GNOME applications should move over to it. GConf is going to be deprecated with GSetting/dconf.

Now what the fuck are you supposed to do as developer wanting to support all tablets and desktop in the same app?

Wednesday, June 16, 2010

How to change hildon context menu content depending on context

Mainly as a reminder to myself, but if you need to change the content of a context menu set with gtk_widget_tap_and_hold_setup() connect the "show" signal and do you show/hide in the signal handler.

Create your menu, connect signal and setup tap-and-hold:
menu=GTK_MENU(hildon_gtk_menu_new());
g_signal_connect(G_OBJECT (menu), "show", G_CALLBACK(menu_items_visibility_cb), NULL);
gtk_widget_tap_and_hold_setup(widget, menu, NULL, 0);

Then in your handler, check what you need and hide/show menu items:
static void
menu_items_visibility_cb(GtkWidget *menu, gpointer data)
{
if (foo) gtk_widget_show(menu_item_foo); else gtk_widget_hide(menu_item_foo);
}