summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/locationinformation.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2019-04-25 13:16:30 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-05-11 12:35:11 -0700
commit32720a7c18f5774e5ac44338bfbac8129b0bc3c9 (patch)
treea3f39f746523500960ee68787e28e124a6c02cd6 /desktop-widgets/locationinformation.cpp
parent4a61f155d3c7bfed7262884019f7bcf1f5b86376 (diff)
downloadsubsurface-32720a7c18f5774e5ac44338bfbac8129b0bc3c9.tar.gz
Dive site: Add button to display all dive sites
On the main dive tab, add a button that opens the dive-site selection widget showing all dive sites. This is done by setting the "temporary dive site name" to the empty string. Thus no dive sites are filtered and the "add new dive site" entries are not shown. Moreover, the text is selected. The user can therefore immediately start typing to activate the filter or enter the name of a new dive site. The idea is that after downloading dives with GPS information the user can select one of the close dive sites. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/locationinformation.cpp')
-rw-r--r--desktop-widgets/locationinformation.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp
index 9f61459b6..dbbe9bf75 100644
--- a/desktop-widgets/locationinformation.cpp
+++ b/desktop-widgets/locationinformation.cpp
@@ -579,6 +579,20 @@ void DiveLocationLineEdit::showPopup()
setTemporaryDiveSiteName(text());
}
+void DiveLocationLineEdit::showAllSites()
+{
+ if (!view->isVisible()) {
+ // By setting the "temporary dive site name" to the empty string,
+ // all dive sites are shown sorted by distance from the site of
+ // the current dive.
+ setTemporaryDiveSiteName(QString());
+
+ // By selecting the whole text, the user can immediately start
+ // typing to activate the full-text filter.
+ selectAll();
+ }
+}
+
DiveLocationLineEdit::DiveSiteType DiveLocationLineEdit::currDiveSiteType() const
{
return currType;