mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 22:35:27 +00:00
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:
parent
7364e6ae9c
commit
b342730ec9
1 changed files with 10 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue