As of last week, the removal of libglade from darktable is functionally complete. The gladefile has been deleted, along with all references to libglade in the code and the Cmake files. Some refactoring may still be ideal, and I’ll be rearranging some code in my free time, but the task is basically completed. Now it’s time to move on to handling keyboard shortcuts.
My plan is to make all keyboard accelerators in darktable application-wide, so that the user won’t have to worry about the current focus when entering a shortcut. There will be mode-specific shortcuts, but nothing module specific. Instead of entering the specific key to use for the shortcut, code registering shortcuts will now instead make an entry in a table with a name for the shortcut and a default key to use, which may be remapped by the user. Remapping will be handled in a tab of the preferences dialog, in similar fashion to the keyboard shortcuts dialog in GIMP.
To actually accomplish this task, I’ve been pleased to discover that GTK+ has two classes, GtkAccelGroup and GtkAccelMap, which support the notion of an accelerator mapping table that I’ve been planning to implement. The GtkAccelGroup connects accelerator paths (which may look like, for instance, “
These classes seem to be exactly what I’m looking for, although the documentation on them is a little bit sparse. To get a good feel for them I’ll spend the next day or so experimenting with them in a tiny project to make sure I understand just what I’m doing, and then I can move on to implementing the new shortcut system in darktable. I’ll probably start by replacing darktable’s existing keyboard shortcut registration system with one that uses the GtkAccelGroup method, and then from there I can move on to creating the user interface to allow user remapping of the shortcuts.