diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-05-22 11:56:03 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-05-22 11:56:03 -0700 |
commit | b342730ec958a6127cfef4e5459cfea96477ac42 (patch) | |
tree | 749aef8d6ab97f1571cab689642c3c2b7a4ebf27 /qt-ui/locationinformation.cpp | |
parent | 7364e6ae9c669828aa3a21d2a97e03cd12f37609 (diff) | |
download | subsurface-b342730ec958a6127cfef4e5459cfea96477ac42.tar.gz |
Location management: actually parse the GPS coordinates
We still don't respond correctly to a user changing them (i.e., the map
doesn't change), but at least once they change the dive to a different
dive and back to this one things get done correctly.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/locationinformation.cpp')
-rw-r--r-- | qt-ui/locationinformation.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/qt-ui/locationinformation.cpp b/qt-ui/locationinformation.cpp index 18f780983..d20a6efc6 100644 --- a/qt-ui/locationinformation.cpp +++ b/qt-ui/locationinformation.cpp @@ -207,10 +207,18 @@ void LocationInformationWidget::enableEdition() ui.diveSiteMessage->setCloseButtonVisible(false); } +extern bool parseGpsText(const QString &gps_text, double *latitude, double *longitude); + void LocationInformationWidget::on_diveSiteCoordinates_textChanged(const QString& text) { - if (!same_string(qPrintable(text), printGPSCoords(currentDs->latitude.udeg, currentDs->longitude.udeg))) - markChangedWidget(ui.diveSiteCoordinates); + if (!same_string(qPrintable(text), printGPSCoords(currentDs->latitude.udeg, currentDs->longitude.udeg))) { + double latitude, longitude; + if (parseGpsText(text, &latitude, &longitude)) { + displayed_dive_site.latitude.udeg = latitude * 1000000; + displayed_dive_site.longitude.udeg = longitude * 1000000; + markChangedWidget(ui.diveSiteCoordinates); + } + } } void LocationInformationWidget::on_diveSiteDescription_textChanged(const QString& text) |