diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-12-23 14:56:40 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-12-23 14:59:38 -0800 |
commit | 9405895285f90932bee9db439fe6a13234f65395 (patch) | |
tree | 31872978e42f3e8975299c59e0dbace14e928530 /qt-ui | |
parent | ebffd75a79c2c0e331df09c584d8cf92736b2260 (diff) | |
download | subsurface-9405895285f90932bee9db439fe6a13234f65395.tar.gz |
Improve GPS string handling
This adds support for two more GPS coordinate formats and also fixes a
couple of issues with the previous implementation.
We used to only support full degrees and decimal minutes. We now also
support fully decimal and degrees, minutes and decimal seconds.
The previous implementation would color the input field red if either it
couldn't parse the string, or if it was able to parse it but it was the
same as the previous location. That's misleading.
The previous implementation also changed all gps coordinates to the new
coordinates in a multi-dive edit - instead of just changing the ones that
are the same as the master dive.
Fixes #387
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/maintab.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 028627292..5d020268c 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -920,11 +920,12 @@ void MainTab::on_notes_textChanged() void MainTab::on_coordinates_textChanged(const QString& text) { - bool gpsChanged = FALSE; - EDIT_SELECTED_DIVES(gpsChanged |= gpsHasChanged(mydive, NULL, text)); + bool gpsChanged = false; + bool parsed = false; + EDIT_SELECTED_DIVES(gpsChanged |= gpsHasChanged(mydive, current_dive, text, &parsed)); if (gpsChanged) { markChangedWidget(ui.coordinates); - } else { + } else if (!parsed) { QPalette p; p.setBrush(QPalette::Base, QColor(Qt::red).lighter()); ui.coordinates->setPalette(p); |