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 667973 - Consider ready-made toggle and radio actions
Consider ready-made toggle and radio actions
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gapplication
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
: 688428 705655 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-01-15 22:38 UTC by Paolo Borelli
Modified: 2018-05-24 13:41 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Paolo Borelli 2012-01-15 22:38:01 UTC
This probably belongs more to the glib side of things...

As far as I can tell, creating toggle menu items or radio menus requires quite a bit of manual handling to get the state from the action variant etc.

It would be nice to have a simpler way to do that, speaking with desrt on irc he mentioned ToggleAction and RadioAction. Even better he also mentioned a GSettingAction to allow a menu to directly map to a gsetting.
Comment 1 Matthias Clasen 2012-01-21 00:40:33 UTC
Moving this to GIO where it belongs.
Comment 2 Allison Karlitskaya (desrt) 2012-01-21 02:14:02 UTC
we have the GSettings action

we will soon have a GObject property action

meanwhile, I think we should either provide stock 'activate' functions for simple actions that are intended to function as toggles/radios or modify the gactionmap 'add from entries' code to do this if the user gives NULL for those pointer types.


in general, I'd like to avoid trying to introduce more places for there to be state.  Stateful actions will obviously be tied to some mechanism or backing store and I think it would be a shame to duplicate the state from that.

This is the approach that the GSettings action takes -- it keeps no state of its own.



The one thing that's missing here, however, is an easy way to emit state change notifications for actions when something else causes them to change (like say, the fullscreen state of the window changes from external sources, remembering that this is not a GObject property).
Comment 3 Matthias Clasen 2013-05-24 02:36:22 UTC
*** Bug 688428 has been marked as a duplicate of this bug. ***
Comment 4 Murray Cumming 2013-09-16 11:17:08 UTC
*** Bug 705655 has been marked as a duplicate of this bug. ***
Comment 5 Murray Cumming 2013-09-16 11:18:49 UTC
In bug #705655 I listed some of the things that app developers need to understand and do to have toggle and radio menu items. It is not a convenient API.
Comment 6 GNOME Infrastructure Team 2018-05-24 13:41:06 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/500.