[polari] Add create_hook parameter to actionEntries



commit 672fd24e05dd69ecc8eb43e103bcfb0da049afa9
Author: Florian Müllner <florian muellner gmail com>
Date:   Sun Jul 21 16:51:29 2013 +0200

    Add create_hook parameter to actionEntries
    
    Inspired by similar code in gnome-documents, mainly useful to hook
    up signals to control an action's sensitivity.

 src/application.js |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index 9a8bdf6..b538abe 100644
--- a/src/application.js
+++ b/src/application.js
@@ -69,14 +69,16 @@ const Application = new Lang.Class({
                             props[prop] = actionEntry[prop];
                     });
                 let action = new Gio.SimpleAction(props);
+                if (actionEntry.create_hook)
+                    actionEntry.create_hook(action);
                 if (actionEntry.activate)
                     action.connect('activate', actionEntry.activate);
                 if (actionEntry.change_state)
                     action.connect('change-state', actionEntry.change_state);
-                this.add_action(action);
                 if (actionEntry.accel)
                     this.add_accelerator(actionEntry.accel,
                                          'app.' + actionEntry.name, null);
+                this.add_action(action);
         }));
 
         this._window = new MainWindow.MainWindow(this);


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