[gnome-documents] manager: add an optional action ID



commit 8953a000d2ac06d40c3f5a042012f6b7712acbd8
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Jul 30 15:07:31 2014 +0200

    manager: add an optional action ID
    
    We're going to use this to build GActions/GMenuModles for the various
    search options.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=725622

 src/manager.js |   10 +++++++++-
 src/search.js  |    6 +++---
 2 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/src/manager.js b/src/manager.js
index 41e136c..2c7e569 100644
--- a/src/manager.js
+++ b/src/manager.js
@@ -31,17 +31,25 @@ const Signals = imports.signals;
 const BaseManager = new Lang.Class({
     Name: 'BaseManager',
 
-    _init: function(title, context) {
+    _init: function(title, actionId, context) {
         this._items = {};
         this._activeItem = null;
         this._title = null;
+        this._actionId = null;
 
         if (title)
             this._title = title;
 
+        if (actionId)
+            this._actionId = actionId;
+
         this.context = context;
     },
 
+    getActionId: function() {
+        return this._actionId;
+    },
+
     getTitle: function() {
         return this._title;
     },
diff --git a/src/search.js b/src/search.js
index 5ce8082..2ba9f07 100644
--- a/src/search.js
+++ b/src/search.js
@@ -111,7 +111,7 @@ const SearchCategoryManager = new Lang.Class({
     Extends: Manager.BaseManager,
 
     _init: function(context) {
-        this.parent(_("Category"), context);
+        this.parent(_("Category"), 'search-category', context);
 
         let category, recent;
         recent = new SearchCategory({ id: SearchCategoryStock.ALL,
@@ -174,7 +174,7 @@ const SearchTypeManager = new Lang.Class({
     _init: function(context) {
         // Translators: "Type" refers to a search filter on the document type
         // (PDF, spreadsheet, ...)
-        this.parent(C_("Search Filter", "Type"), context);
+        this.parent(C_("Search Filter", "Type"), 'search-type', context);
 
         this.addItem(new SearchType({ id: SearchTypeStock.ALL,
                                       name: _("All") }));
@@ -259,7 +259,7 @@ const SearchMatchManager = new Lang.Class({
     _init: function(context) {
         // Translators: this is a verb that refers to "All", "Title" and "Author",
         // as in "Match All", "Match Title" and "Match Author"
-        this.parent(_("Match"), context);
+        this.parent(_("Match"), 'search-match', context);
 
         this.addItem(new SearchMatch({ id: SearchMatchStock.ALL,
                                        name: _("All") }));


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