diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-01-19 18:15:03 +1200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-19 18:15:03 +1200 |
commit | de9acbd30d5af81d5774a92e4734e04cdb3084b1 (patch) | |
tree | d8610aba6b152832d6a2b894584fbb77f546db2c /qt-ui/maintab.cpp | |
parent | 93058f28ea886b06a012daeba49c3c9eb95a587d (diff) | |
parent | f448bfd574bb9aa4593b43392131174dc489a4b0 (diff) | |
download | subsurface-de9acbd30d5af81d5774a92e4734e04cdb3084b1.tar.gz |
Merge branch 'latestmaster'
Diffstat (limited to 'qt-ui/maintab.cpp')
-rw-r--r-- | qt-ui/maintab.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/qt-ui/maintab.cpp b/qt-ui/maintab.cpp index 3c00a1bed..be55f6f29 100644 --- a/qt-ui/maintab.cpp +++ b/qt-ui/maintab.cpp @@ -428,7 +428,7 @@ void MainTab::updateDiveInfo(bool clear) ui.DiveType->setCurrentIndex(displayed_dive.dc.divemode); if (!clear) { - updateGpsCoordinates(&displayed_dive); + updateGpsCoordinates(); // Subsurface always uses "local time" as in "whatever was the local time at the location" // so all time stamps have no time zone information and are in UTC QDateTime localTime = QDateTime::fromTime_t(displayed_dive.when - gettimezoneoffset(displayed_dive.when)); @@ -750,7 +750,7 @@ void MainTab::acceptChanges() } struct dive *cd = current_dive; //Reset coordinates field, in case it contains garbage. - updateGpsCoordinates(&displayed_dive); + updateGpsCoordinates(); // now check if something has changed and if yes, edit the selected dives that // were identical with the master dive shown (and mark the divelist as changed) if (!same_string(displayed_dive.buddy, cd->buddy)) @@ -1137,7 +1137,7 @@ void MainTab::on_location_editingFinished() displayed_dive.latitude = dive->latitude; displayed_dive.longitude = dive->longitude; MainWindow::instance()->globe()->reload(); - updateGpsCoordinates(&displayed_dive); + updateGpsCoordinates(); break; } } @@ -1244,14 +1244,13 @@ void MainTab::updateCoordinatesText(qreal lat, qreal lon) ui.coordinates->setText(printGPSCoords(ulat, ulon)); } -void MainTab::updateGpsCoordinates(const struct dive *dive) +void MainTab::updateGpsCoordinates() { - if (dive) { - ui.coordinates->setText(printGPSCoords(dive->latitude.udeg, dive->longitude.udeg)); - ui.coordinates->setModified(dive->latitude.udeg || dive->longitude.udeg); - } else { - ui.coordinates->clear(); - } + if (editMode == NONE) + enableEdition(); + + ui.coordinates->setText(printGPSCoords(displayed_dive.latitude.udeg, displayed_dive.longitude.udeg)); + ui.coordinates->setModified(displayed_dive.latitude.udeg || displayed_dive.longitude.udeg); } void MainTab::escDetected() @@ -1300,7 +1299,7 @@ void MainTab::showAndTriggerEditSelective(struct dive_components what) if (what.visibility) ui.visibility->setCurrentStars(displayed_dive.visibility); if (what.gps) - updateGpsCoordinates(&displayed_dive); + updateGpsCoordinates(); if (what.tags) { char buf[1024]; taglist_get_tagstring(displayed_dive.tag_list, buf, 1024); |