diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-09-22 08:45:14 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-09-22 08:45:14 -0700 |
commit | 799b56a1f39fa09b3b6160465199e5dd1780df31 (patch) | |
tree | 0523610eda261865a2b9c574f9c8ac79f712df8e | |
parent | 9820ca5edaa3b3da1bf02f9b56714e47ff4ea978 (diff) | |
download | subsurface-799b56a1f39fa09b3b6160465199e5dd1780df31.tar.gz |
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 <dirk@hohndel.org>
-rw-r--r-- | qt-ui/diveplanner.cpp | 5 |
1 files 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<DiveHandler*>(item)) { activeDraggedHandler = h; |