summaryrefslogtreecommitdiffstats
path: root/qt-ui/globe.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-11-17 18:17:41 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-17 13:39:36 -0800
commit188cdc7d0617f46afbc71d1eb21b0058c3447a30 (patch)
tree710a81a009b5d0b2834e455da018ad52b5ac4f30 /qt-ui/globe.cpp
parent1b77b67fdf7048292ff5fe80ab1688a0497aaae1 (diff)
downloadsubsurface-188cdc7d0617f46afbc71d1eb21b0058c3447a30.tar.gz
Make it possible to set the coordinates via map for all selected dives.
This patch makes it possible to set the coordinates on the map for all selected dives. Note however that after a coordinate is set, user cannot edit it unless he multi-edit it with a dive that doesn't have coordinate's set. this is just because it's missing a 'edit coords' button. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/globe.cpp')
-rw-r--r--qt-ui/globe.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index aeaab2903..149f738e3 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -222,13 +222,20 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U
if (!editingDiveCoords)
return;
- editingDiveCoords->latitude.udeg = lrint(lat * 1000000.0);
- editingDiveCoords->longitude.udeg = lrint(lon * 1000000.0);
+ /* change everything on the selection. */
+ 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);
- reload();
editingDiveCoords = 0;
- messageWidget->animatedHide();
mark_divelist_changed(TRUE);
+ messageWidget->animatedHide();
+ mainWindow()->refreshDisplay();
}
void GlobeGPS::mousePressEvent(QMouseEvent* event)