[gnome-documents] search: clear string and type filters when entering a collection
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] search: clear string and type filters when entering a collection
- Date: Thu, 1 Mar 2012 18:30:41 +0000 (UTC)
commit cb064a4989c1ba2fc101d7f4dcdabe22bb04356c
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Wed Feb 29 22:37:38 2012 -0500
search: clear string and type filters when entering a collection
When we select a collection from search results, we have to clear the
filters that might be unwanted in the contents of that collection.
src/searchbar.js | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/searchbar.js b/src/searchbar.js
index 89c73f1..89c1b8b 100644
--- a/src/searchbar.js
+++ b/src/searchbar.js
@@ -417,6 +417,8 @@ Searchbar.prototype = {
Lang.bind(this, this._onActiveTypeChanged));
this._searchMatchId = Global.searchMatchManager.connect('active-changed',
Lang.bind(this, this._onActiveMatchChanged));
+ this._collectionId = Global.collectionManager.connect('active-changed',
+ Lang.bind(this, this._onActiveCollectionChanged));
this._onActiveSourceChanged();
this._onActiveTypeChanged();
@@ -499,6 +501,16 @@ Searchbar.prototype = {
this.widget.show_all();
},
+ _onActiveCollectionChanged: function() {
+ let searchType = Global.sourceManager.getActiveItem();
+
+ if (Global.searchController.getString() != '' ||
+ searchType.id != 'all') {
+ Global.searchTypeManager.setActiveItemById('all');
+ this._searchEntry.set_text('');
+ }
+ },
+
destroy: function() {
if (this._searchFocusId != 0) {
Global.searchController.disconnect(this._searchFocusId);
@@ -530,6 +542,11 @@ Searchbar.prototype = {
this._searchDropdownId = 0;
}
+ if (this._collectionId != 0) {
+ Global.searchController.disconnect(this._collectionId);
+ this._collectionId = 0;
+ }
+
this.widget.destroy();
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]