summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2012-04-23 10:58:51 (GMT)
committerKevin Smith <git@kismith.co.uk>2012-04-23 12:27:54 (GMT)
commitae77eccb397460676b4df8297beaebcc1394faec (patch)
treed7cef13176863f4dbee56d5e07e4df5438903ddf /Swift/QtUI/UserSearch/QtUserSearchResultsPage.cpp
parent39d46fb62ef01c3394ec0b453229f8d703f75153 (diff)
downloadswift-contrib-ae77eccb397460676b4df8297beaebcc1394faec.zip
swift-contrib-ae77eccb397460676b4df8297beaebcc1394faec.tar.bz2
Explicitly show "No results." if a user search yields to no results on the results page.
Resolves: #811 License: This patch is BSD-licensed, see http://www.opensource.org/licenses/bsd-license.php
Diffstat (limited to 'Swift/QtUI/UserSearch/QtUserSearchResultsPage.cpp')
-rw-r--r--Swift/QtUI/UserSearch/QtUserSearchResultsPage.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Swift/QtUI/UserSearch/QtUserSearchResultsPage.cpp b/Swift/QtUI/UserSearch/QtUserSearchResultsPage.cpp
index bc6933e7..dcd79d2 100644
--- a/Swift/QtUI/UserSearch/QtUserSearchResultsPage.cpp
+++ b/Swift/QtUI/UserSearch/QtUserSearchResultsPage.cpp
@@ -15,12 +15,23 @@ QtUserSearchResultsPage::QtUserSearchResultsPage() {
connect(results_, SIGNAL(clicked(const QModelIndex&)), this, SLOT(emitCompletenessCheck()));
connect(results_, SIGNAL(entered(const QModelIndex&)), this, SLOT(emitCompletenessCheck()));
results_->setExpandsOnDoubleClick(false);
+ setNoResults(false);
}
bool QtUserSearchResultsPage::isComplete() const {
return results_->currentIndex().isValid();
}
+void QtUserSearchResultsPage::setNoResults(bool noResults) {
+ if (noResults) {
+ results_->setEnabled(false);
+ noResults_->show();
+ } else {
+ results_->setEnabled(true);
+ noResults_->hide();
+ }
+}
+
void QtUserSearchResultsPage::emitCompletenessCheck() {
emit completeChanged();
}