diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-02-12 12:57:58 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-12 11:19:27 -0800 |
commit | 9ef81d3ed38bd2e7498242095e1655d568c61f7e (patch) | |
tree | e925f0b2519add2e0b241fa8a063ecce113442f0 /qt-ui | |
parent | 6a812c6b6dfffca3c99f4076005de6ee9f11d614 (diff) | |
download | subsurface-9ef81d3ed38bd2e7498242095e1655d568c61f7e.tar.gz |
Show GPS coordinates based on dive site on MainTab
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/maintab.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 48d2a0034..363ab3c43 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -1286,8 +1286,14 @@ void MainTab::updateGpsCoordinates() if (editMode == NONE) enableEdition(); - ui.coordinates->setText(printGPSCoords(displayed_dive.latitude.udeg, displayed_dive.longitude.udeg)); - ui.coordinates->setModified(displayed_dive.latitude.udeg || displayed_dive.longitude.udeg); + struct dive_site *ds = get_dive_site_by_uuid(displayed_dive.dive_site_uuid); + if (ds && dive_site_has_gps_location(ds)) { + ui.coordinates->setText(printGPSCoords(ds->latitude.udeg, ds->longitude.udeg)); + ui.coordinates->setModified(true); + } else if (!ui.coordinates->text().isEmpty()) { + ui.coordinates->setModified(true); + ui.coordinates->clear(); + } } void MainTab::escDetected() |