diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-01-19 17:32:17 +1200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-01-19 17:38:17 +1200 |
commit | df46b85ee1cc7a33fe35e69c19345a59c966fa41 (patch) | |
tree | 88951ed5fdb90ca23db73afe181a0279e79fbf2a /qt-ui/globe.cpp | |
parent | 83018619d6f22efda3a98742598670d7bd76482b (diff) | |
download | subsurface-df46b85ee1cc7a33fe35e69c19345a59c966fa41.tar.gz |
Don't just change the location when double clicking on the globe
Instead be consistent with other parts of the code and put us in editing
mode so the user can accept / reject the change.
See #800
Fixes #801
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/globe.cpp')
-rw-r--r-- | qt-ui/globe.cpp | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index c2bbeb415..d8beff91d 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -307,21 +307,14 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U lon = lon * 180 / M_PI; lat = lat * 180 / M_PI; } - - // right now we try to only ever do this with one dive selected, - // but we keep the code here that changes the coordinates for each selected dive - int i; - struct dive *dive; - for_each_dive (i, dive) { - if (!dive->selected) - continue; - dive->latitude.udeg = lrint(lat * 1000000.0); - dive->longitude.udeg = lrint(lon * 1000000.0); - } centerOn(lon, lat, true); + + // change the location of the displayed_dive and put the UI in edit mode + displayed_dive.latitude.udeg = lrint(lat * 1000000.0); + displayed_dive.longitude.udeg = lrint(lon * 1000000.0); + emit(coordinatesChanged()); + repopulateLabels(); editingDiveLocation = false; - mark_divelist_changed(true); - MainWindow::instance()->refreshDisplay(); } void GlobeGPS::mousePressEvent(QMouseEvent *event) |