summaryrefslogtreecommitdiffstats
path: root/qt-ui/globe.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-01 21:21:59 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-01 21:25:20 -0700
commit7a85b9fb27f96c55e11e904fe3a68eba4ca79eba (patch)
tree383fdd01d7dfdbd2ca0c41ac125d06cb0b81d44a /qt-ui/globe.cpp
parent4243fcb9156218f54b3103ce7c8de6ea222f3cfb (diff)
downloadsubsurface-7a85b9fb27f96c55e11e904fe3a68eba4ca79eba.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/globe.cpp')
-rw-r--r--qt-ui/globe.cpp6
1 files changed, 5 insertions, 1 deletions
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);