From 799b56a1f39fa09b3b6160465199e5dd1780df31 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 22 Sep 2013 08:45:14 -0700 Subject: Don't exit profile editor when hitting ESC in dive add mode I'm sure there are more issues like this where we need to handle things differently depending on whether we are planning a dive or adding a dive. Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index a23d03d03..89da3b4b4 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -340,7 +340,8 @@ void DivePlannerGraphics::keyEscAction() scene()->clearSelection(); return; } - plannerModel->cancelPlan(); + if (DivePlannerPointsModel::instance()->isPlanner()) + plannerModel->cancelPlan(); } qreal DivePlannerGraphics::fromPercent(qreal percent, Qt::Orientation orientation) @@ -602,7 +603,7 @@ void DivePlannerGraphics::mousePressEvent(QMouseEvent* event) return; } - QPointF mappedPos = mapToScene(event->pos()); + QPointF mappedPos = mapToScene(event->pos()); Q_FOREACH(QGraphicsItem *item, scene()->items(mappedPos, Qt::IntersectsItemBoundingRect, Qt::AscendingOrder, transform())){ if (DiveHandler *h = qgraphicsitem_cast(item)) { activeDraggedHandler = h; -- cgit v1.2.3-70-g09d2