From 8b796e745d98f8d64765911a69348d7d4d34dc03 Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Sat, 3 Sep 2011 12:01:33 +0200 Subject: [PATCH] overview: Add public API to add search providers Add a addSearchProvider() method, so extensions don't have to access the view selector directly, which is now a private property of the overview. https://bugzilla.gnome.org/show_bug.cgi?id=658113 --- js/ui/overview.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/js/ui/overview.js b/js/ui/overview.js index bb050e3b7..6b36771c9 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -208,11 +208,11 @@ Overview.prototype = { this._viewSelector.addViewTab('applications', _("Applications"), appView.actor, 'system-run'); // Default search providers - this._viewSelector.addSearchProvider(new AppDisplay.AppSearchProvider()); - this._viewSelector.addSearchProvider(new AppDisplay.SettingsSearchProvider()); - this._viewSelector.addSearchProvider(new PlaceDisplay.PlaceSearchProvider()); - this._viewSelector.addSearchProvider(new DocDisplay.DocSearchProvider()); - this._viewSelector.addSearchProvider(new ContactDisplay.ContactSearchProvider()); + this.addSearchProvider(new AppDisplay.AppSearchProvider()); + this.addSearchProvider(new AppDisplay.SettingsSearchProvider()); + this.addSearchProvider(new PlaceDisplay.PlaceSearchProvider()); + this.addSearchProvider(new DocDisplay.DocSearchProvider()); + this.addSearchProvider(new ContactDisplay.ContactSearchProvider()); // TODO - recalculate everything when desktop size changes this._dash = new Dash.Dash(); @@ -233,6 +233,10 @@ Overview.prototype = { this._relayout(); }, + addSearchProvider: function(provider) { + this._viewSelector.addSearchProvider(provider); + }, + setMessage: function(text, undoCallback, undoLabel) { if (this.isDummy) return;