From 7a85b9fb27f96c55e11e904fe3a68eba4ca79eba Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 1 May 2014 21:21:59 -0700 Subject: [PATCH] Only change dive coordinates on double click Apparently this only happens on Windows, but there we would change the dive coordinates on a SINGLE click when editing a dive. With this change we simply bail if the event isn't a double click. Fixes #505 Signed-off-by: Dirk Hohndel --- qt-ui/globe.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index 1fcbdea1d..8f519cf94 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -289,7 +289,8 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U lat = lat * 180 / M_PI; } - /* change everything on the selection. */ + // right now we try to only ever do this with one dive selected, + // but we keep the code here that changes the coordinates for each selected dive int i; struct dive *dive; for_each_dive(i, dive) { @@ -306,6 +307,9 @@ void GlobeGPS::changeDiveGeoPosition(qreal lon, qreal lat, GeoDataCoordinates::U void GlobeGPS::mousePressEvent(QMouseEvent *event) { + if (event->type() != QEvent::MouseButtonDblClick) + return; + qreal lat, lon; bool clickOnGlobe = geoCoordinates(event->pos().x(), event->pos().y(), lon, lat, GeoDataCoordinates::Degree);