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>
This commit is contained in:
Dirk Hohndel 2015-05-22 11:56:03 -07:00
parent 7364e6ae9c
commit b342730ec9

View file

@ -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)