Show "No matching results" if that's the case

This also fixes backtracking from no matching results.

https://bugzilla.gnome.org/show_bug.cgi?id=606209
This commit is contained in:
Colin Walters 2010-01-06 15:00:49 -05:00
parent 71786e50cf
commit 69c8aef6c2

View File

@ -433,9 +433,8 @@ SearchResults.prototype = {
this.actor = new St.BoxLayout({ name: 'dashSearchResults', this.actor = new St.BoxLayout({ name: 'dashSearchResults',
vertical: true }); vertical: true });
this._searchingNotice = new St.Label({ style_class: 'dash-search-starting', this._statusText = new St.Label({ style_class: 'dash-search-statustext' });
text: _("Searching...") }); this.actor.add(this._statusText);
this.actor.add(this._searchingNotice);
this._selectedProvider = -1; this._selectedProvider = -1;
this._providers = this._searchSystem.getProviders(); this._providers = this._searchSystem.getProviders();
this._providerMeta = []; this._providerMeta = [];
@ -485,13 +484,14 @@ SearchResults.prototype = {
reset: function() { reset: function() {
this._searchSystem.reset(); this._searchSystem.reset();
this._searchingNotice.hide(); this._statusText.hide();
this._clearDisplay(); this._clearDisplay();
}, },
startingSearch: function() { startingSearch: function() {
this.reset(); this.reset();
this._searchingNotice.show(); this._statusText.set_text(_("Searching..."));
this._statusText.show();
}, },
_metaForProvider: function(provider) { _metaForProvider: function(provider) {
@ -501,9 +501,16 @@ SearchResults.prototype = {
updateSearch: function (searchString) { updateSearch: function (searchString) {
let results = this._searchSystem.updateSearch(searchString); let results = this._searchSystem.updateSearch(searchString);
this._searchingNotice.hide();
this._clearDisplay(); this._clearDisplay();
if (results.length == 0) {
this._statusText.set_text(_("No matching results."));
this._statusText.show();
return true;
} else {
this._statusText.hide();
}
let terms = this._searchSystem.getTerms(); let terms = this._searchSystem.getTerms();
for (let i = 0; i < results.length; i++) { for (let i = 0; i < results.length; i++) {