summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-ui/locationinformation.cpp12
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)