After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 726370 - Port to GAction and GActionGroup vs the approach of setting accelerators directly on widgets
Port to GAction and GActionGroup vs the approach of setting accelerators dire...
Status: RESOLVED FIXED
Product: pitivi
Classification: Other
Component: General
Git
Other Linux
: High normal
: 0.94
Assigned To: Pitivi maintainers
Pitivi maintainers
Depends on:
Blocks: 708375
 
 
Reported: 2014-03-14 20:04 UTC by Jean-François Fortin Tam
Modified: 2014-04-02 17:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jean-François Fortin Tam 2014-03-14 20:04:44 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.
Comment 1 Alex Băluț 2014-03-23 22:05:53 UTC
Implemented here on top of your headerbar branch:
https://github.com/aleb/pitivi/commits/headerbar
Comment 2 Jean-François Fortin Tam 2014-04-02 17:01:02 UTC
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