GNOME Bugzilla – Bug 726370
Port to GAction and GActionGroup vs the approach of setting accelerators directly on widgets
Last modified: 2014-04-02 17:01:02 UTC
So, for bug #708375 I have a branch here: https://github.com/nekohayo/pitivi/commits/headerbar When I did this implementation, I noticed that GtkAction/GtkActionGroup are deprecated, meant to be replaced by GAction and GActionGroup, which are concepts/abstract notions that are actually implemented by Gio... https://developer.gnome.org/gio/stable/GAction.html https://developer.gnome.org/gio/stable/GActionGroup.html https://developer.gnome.org/gio/stable/GActionMap.html but those are only "interfaces", you're actually supposed to either write your own or to use: https://developer.gnome.org/gio/stable/GSimpleAction.html https://developer.gnome.org/gio/stable/GSimpleActionGroup.html The actual approach/API is quite different from GtkAction/GtkActionGroup. I tried using it and eventually ended up flipping the table (╯°□°)╯︵ ┻━┻ and just setting the (very few) keyboard shortcuts we need for mainwindow directly onto button widgets and menu items. I consider that approach to be much simpler and easier to work with, with advantages such as the fact that if you set a widget as insensitive, it automatically makes the related keyboard shortcut insensitive, no need to manage things twice. Mathieu and Thibault disagree with this approach as they are certain that using GAction/GActionGroup is the "right" way to do it. That's alright, but I need proof and working code to compare against my working code :) So, someone needs to actually try porting to GSimpleAction/GSimpleActionGroup and evaluate if, *in practice*, this approach actually is superior and easy enough to manage. We need an objective evaluation of this. If this is as simple/clean as Mathieu and Thibault say, then anyone studying this problem (and is able to make sense of the documentation above) could make a standalone patch against master, on top of which I would then rebase my headerbar branch.
Implemented here on top of your headerbar branch: https://github.com/aleb/pitivi/commits/headerbar
commit 9d171bff76df34f923f171d3e465955a1e016ddc Author: Alexandru Băluț <alexandru.balut@gmail.com> Date: Tue Mar 18 23:49:04 2014 +0100 Use Gio.SimpleActions to handle global app keyboard events