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>
This commit is contained in:
Dirk Hohndel 2013-09-22 08:45:14 -07:00
parent 9820ca5eda
commit 799b56a1f3

View file

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