From 32720a7c18f5774e5ac44338bfbac8129b0bc3c9 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Thu, 25 Apr 2019 13:16:30 +0200 Subject: 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 --- desktop-widgets/tab-widgets/maintab.cpp | 5 +++++ desktop-widgets/tab-widgets/maintab.h | 1 + desktop-widgets/tab-widgets/maintab.ui | 7 +++++++ 3 files changed, 13 insertions(+) (limited to 'desktop-widgets/tab-widgets') diff --git a/desktop-widgets/tab-widgets/maintab.cpp b/desktop-widgets/tab-widgets/maintab.cpp index e70e79ce2..af1928e2d 100644 --- a/desktop-widgets/tab-widgets/maintab.cpp +++ b/desktop-widgets/tab-widgets/maintab.cpp @@ -829,6 +829,11 @@ void MainTab::on_location_diveSiteSelected() Command::editDiveSite(newDs, false); } +void MainTab::on_locationPopupButton_clicked() +{ + ui.location->showAllSites(); +} + void MainTab::on_diveTripLocation_editingFinished() { if (!currentTrip) diff --git a/desktop-widgets/tab-widgets/maintab.h b/desktop-widgets/tab-widgets/maintab.h index cdb761afd..351449cd7 100644 --- a/desktop-widgets/tab-widgets/maintab.h +++ b/desktop-widgets/tab-widgets/maintab.h @@ -57,6 +57,7 @@ slots: void acceptChanges(); void rejectChanges(); void on_location_diveSiteSelected(); + void on_locationPopupButton_clicked(); void on_divemaster_editingFinished(); void on_buddy_editingFinished(); void on_suit_editingFinished(); diff --git a/desktop-widgets/tab-widgets/maintab.ui b/desktop-widgets/tab-widgets/maintab.ui index 24d21fece..ee0e66b1e 100644 --- a/desktop-widgets/tab-widgets/maintab.ui +++ b/desktop-widgets/tab-widgets/maintab.ui @@ -216,6 +216,13 @@ + + + + ... + + + -- cgit v1.2.3-70-g09d2