From 3677f4e5ead410d4023668420ca4f062c4223888 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 6 Jun 2013 14:07:07 +0900 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/globe.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'qt-ui') 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; } -- cgit v1.2.3-70-g09d2