summaryrefslogtreecommitdiffstats
path: root/qt-ui/globe.cpp
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2013-06-06 14:07:07 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-06-07 13:36:15 +0900
commit3677f4e5ead410d4023668420ca4f062c4223888 (patch)
tree5f3c4d98a05ff069f07a0fb6aea50dbb71d21593 /qt-ui/globe.cpp
parentd3442a81b3c24fb4e0726baaed42c669e1c102a4 (diff)
downloadsubsurface-3677f4e5ead410d4023668420ca4f062c4223888.tar.gz
Allow ctrl-click to select dives incrementally from the globe view
I guess we should support de-selecting dives this way too, but right now the interfaces only do selection. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/globe.cpp')
-rw-r--r--qt-ui/globe.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index 20c913bbd..78283e49e 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -81,6 +81,7 @@ void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
int idx;
struct dive *dive;
+ bool clear = !(QApplication::keyboardModifiers() && Qt::ControlModifier);
bool first = true;
for_each_dive(idx, dive) {
long lat_diff, lon_diff;
@@ -95,8 +96,10 @@ void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
if (lat_diff > resolve || lon_diff > resolve)
continue;
- if (first)
+ if (clear) {
mainWindow()->dive_list()->unselectDives();
+ clear = false;
+ }
mainWindow()->dive_list()->selectDive(dive, first);
first = false;
}