diff options
author | Tomaz Canabrava <tomaz.canabrava@gmail.com> | 2015-06-03 22:53:38 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-06-03 21:32:36 -0700 |
commit | fa373fd5444a8d72782424db5ba301d1b678821d (patch) | |
tree | 51088eb9088fc17a591f284af1d659305dc09d77 /qt-ui | |
parent | 7507c96dcdae77fadaacdd10d671816797b5be44 (diff) | |
download | subsurface-fa373fd5444a8d72782424db5ba301d1b678821d.tar.gz |
Rework the method to pick a dive site via the globe
The globe used to allow the user to pick a dive site if the dive didn't
have coordinates, but this is now wrong since when in dive site editing
mode we can select multiple times new coordinates for it, and it should
only be marked as finished when the user actually finishes it.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/globe.cpp | 24 | ||||
-rw-r--r-- | qt-ui/globe.h | 2 |
2 files changed, 16 insertions, 10 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index d4c7d49eb..3dc5c99ce 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -298,18 +298,22 @@ void GlobeGPS::zoomOutForNoGPS() } } +void GlobeGPS::endGetDiveCoordinates() +{ + messageWidget->animatedHide(); + editingDiveLocation = false; +} + void GlobeGPS::prepareForGetDiveCoordinates() { - if (!messageWidget->isVisible()) { - messageWidget->setMessageType(KMessageWidget::Warning); - messageWidget->setText(QObject::tr("Move the map and double-click to set the dive location")); - messageWidget->setWordWrap(true); - messageWidget->setCloseButtonVisible(false); - messageWidget->animatedShow(); - editingDiveLocation = true; - if (!dive_has_gps_location(current_dive)) - zoomOutForNoGPS(); - } + messageWidget->setMessageType(KMessageWidget::Warning); + messageWidget->setText(QObject::tr("Move the map and double-click to set the dive location")); + messageWidget->setWordWrap(true); + messageWidget->setCloseButtonVisible(false); + messageWidget->animatedShow(); + editingDiveLocation = true; + if (!dive_has_gps_location(current_dive)) + zoomOutForNoGPS(); } // This needs to update the dive site, not just this dive diff --git a/qt-ui/globe.h b/qt-ui/globe.h index ab03e1266..5d25de3b0 100644 --- a/qt-ui/globe.h +++ b/qt-ui/globe.h @@ -49,6 +49,8 @@ slots: void fixZoom(); void zoomOutForNoGPS(); void prepareForGetDiveCoordinates(); + void endGetDiveCoordinates(); + }; #else // NO_MARBLE |