diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-02-13 12:38:56 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-13 14:27:35 -0800 |
commit | 32ad046f5681ad02e3f9842075447e880145267d (patch) | |
tree | 4679bac9d6f20acbecebb20a8a05a634534c1808 /qt-ui/globe.cpp | |
parent | 06e578424e272b1c500c2a9e79b4367465fb4ac8 (diff) | |
download | subsurface-32ad046f5681ad02e3f9842075447e880145267d.tar.gz |
Allow editing of dive sites
And hook things up when double clicking the globe.
The user experience isn't consistent with what we do on the main tab
(i.e., no coloring of fields that are changed), but it seems to work.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/globe.cpp')
-rw-r--r-- | qt-ui/globe.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index 256eff175..91bb4e858 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -206,7 +206,10 @@ void GlobeGPS::repopulateLabels() // don't show that flag, it's either already shown as displayed_dive // or it's the one that we are moving right now... continue; - ds = get_dive_site_for_dive(dive); + if (idx == -1) + ds = &displayed_dive_site; + else + ds = get_dive_site_for_dive(dive); if (dive_site_has_gps_location(ds)) { GeoDataPlacemark *place = new GeoDataPlacemark(ds->name); place->setCoordinate(ds->longitude.udeg / 1000000.0, ds->latitude.udeg / 1000000.0, 0, GeoDataCoordinates::Degree); @@ -329,9 +332,8 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U centerOn(lon, lat, true); // change the location of the displayed_dive and put the UI in edit mode - ds = get_dive_site_for_dive(&displayed_dive); - ds->latitude.udeg = lrint(lat * 1000000.0); - ds->longitude.udeg = lrint(lon * 1000000.0); + displayed_dive_site.latitude.udeg = lrint(lat * 1000000.0); + displayed_dive_site.longitude.udeg = lrint(lon * 1000000.0); emit(coordinatesChanged()); repopulateLabels(); editingDiveLocation = false; |