[gnome-maps] Allow to create stateful actions



commit f43f8bbc88de53b409936ec0b525f222717d9c3c
Author: Paolo Borelli <pborelli gnome org>
Date:   Tue Apr 16 18:25:36 2013 +0200

    Allow to create stateful actions

 src/utils.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/utils.js b/src/utils.js
index 7e1721c..b112db3 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -76,7 +76,11 @@ function clearGtkClutterActorBg(actor) {
 
 function initActions(actionMap, simpleActionEntries) {
     simpleActionEntries.forEach(function(entry) {
-        let action = new Gio.SimpleAction({ name: entry.name });
+        let actionParams = { name: entry.name };
+        if (entry.state)
+            actionParams.state = entry.state;
+
+        let action = new Gio.SimpleAction(actionParams);
 
         if (entry.callback)
             action.connect('activate', Lang.bind(actionMap, entry.callback));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]