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 668279 - create GAction from GSettings
create GAction from GSettings
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gsettings
unspecified
Other All
: Normal normal
: ---
Assigned To: Allison Karlitskaya (desrt)
gtkdev
Depends on: 668269
Blocks:
 
 
Reported: 2012-01-19 15:50 UTC by Allison Karlitskaya (desrt)
Modified: 2012-01-20 18:25 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
add a way to create a GAction from GSettings (10.26 KB, patch)
2012-01-19 15:50 UTC, Allison Karlitskaya (desrt)
committed Details | Review
tests for GSettings action binding (2.55 KB, patch)
2012-01-19 15:50 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2012-01-19 15:50:28 UTC
This will let you whack some gsettings keys directly into the action
group of your application for easy access from your menus.
Comment 1 Allison Karlitskaya (desrt) 2012-01-19 15:50:29 UTC
Created attachment 205630 [details] [review]
add a way to create a GAction from GSettings

g_settings_create_action() will create a GAction for the named key,
allowing it to be added to the action group of the application (so that
the setting can be directly manipulated from menus, for example).
Comment 2 Allison Karlitskaya (desrt) 2012-01-19 15:50:32 UTC
Created attachment 205631 [details] [review]
tests for GSettings action binding
Comment 3 Allison Karlitskaya (desrt) 2012-01-19 15:51:05 UTC
need the patch from bug 668269 for these, btw
Comment 4 Matthias Clasen 2012-01-19 18:35:26 UTC
Review of attachment 205630 [details] [review]:

Looks nice, I think. The only thing missing is a testcase
Comment 5 Matthias Clasen 2012-01-19 18:36:14 UTC
Review of attachment 205631 [details] [review]:

Aaand...there it is.
Comment 6 Matthias Clasen 2012-01-19 18:37:49 UTC
Would be good to also show this off on the gtk side.
What we really need is some nice article about best practices for
using gsettings in a gtk app.