[gnome-documents/wip/rishi/split-view: 14/17] application: Let some actions be enabled across multiple window modes
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents/wip/rishi/split-view: 14/17] application: Let some actions be enabled across multiple window modes
- Date: Tue, 10 Feb 2015 15:06:49 +0000 (UTC)
commit f482ced2dff9b315e0c991bf9440117cc1d7be91
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Feb 10 15:57:38 2015 +0100
application: Let some actions be enabled across multiple window modes
With multiple views, those actions which were only needed in the
overview will need to work in the documents, collections and search
views also.
https://bugzilla.gnome.org/show_bug.cgi?id=686461
src/application.js | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index ca0abad..391e924 100644
--- a/src/application.js
+++ b/src/application.js
@@ -314,6 +314,20 @@ const Application = new Lang.Class({
let action = this.lookup_action(actionEntry.name);
action.set_enabled(mode == actionEntry.window_mode);
}));
+ } else if (actionEntry.window_modes) {
+ modeController.connect('window-mode-changed', Lang.bind(this,
+ function() {
+ let mode = modeController.getWindowMode();
+ let action = this.lookup_action(actionEntry.name);
+ let enable = false;
+ for (let idx in actionEntry.window_modes) {
+ if (mode == actionEntry.window_modes[idx]) {
+ enable = true;
+ break;
+ }
+ }
+ action.set_enabled(enable);
+ }));
}
}));
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]