mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
ebffd75a79
commit
9405895285
3 changed files with 50 additions and 13 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue