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>
This commit is contained in:
Linus Torvalds 2013-06-06 14:07:07 +09:00 committed by Dirk Hohndel
parent d3442a81b3
commit 3677f4e5ea

View file

@ -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;
}