diff options
Diffstat (limited to 'qt-ui/globe.cpp')
-rw-r--r-- | qt-ui/globe.cpp | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index f8bf1828a..1546a8bb5 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -235,25 +235,21 @@ void GlobeGPS::reload() repopulateLabels(); } -void GlobeGPS::centerOnCurrentDive() +void GlobeGPS::centerOnDiveSite(uint32_t uuid) { - struct dive_site *ds = get_dive_site_for_dive(current_dive); - // dive has changed, if we had the 'editingDive', hide it. - if (messageWidget->isVisible() && (!ds || dive_site_has_gps_location(ds) || amount_selected != 1)) - messageWidget->hide(); - - editingDiveLocation = false; - if (!ds) + if (uuid == 0) return; - qreal longitude = ds->longitude.udeg / 1000000.0; - qreal latitude = ds->latitude.udeg / 1000000.0; + struct dive_site *ds = get_dive_site_by_uuid(uuid); if (!dive_site_has_gps_location(ds)) { zoomOutForNoGPS(); return; } + qreal longitude = ds->longitude.udeg / 1000000.0; + qreal latitude = ds->latitude.udeg / 1000000.0; + // if no zoom is set up, set the zoom as seen from 3km above // if we come back from a dive without GPS data, reset to the last zoom value // otherwise check to make sure we aren't still running an animation and then remember |