From 09403f37245e95d851d4470445729afab46fc0fe Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 3 Jun 2014 15:26:06 -0700 Subject: Planner: reject plan if escape key is pressed This seems intuitive. Signed-off-by: Dirk Hohndel --- qt-ui/diveplanner.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'qt-ui/diveplanner.cpp') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 92d90bc1c..1b4427df6 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -282,6 +283,8 @@ DivePlannerWidget::DivePlannerWidget(QWidget *parent, Qt::WindowFlags f) : QWidg // Creating (and canceling) the plan connect(ui.buttonBox, SIGNAL(accepted()), plannerModel, SLOT(createPlan())); connect(ui.buttonBox, SIGNAL(rejected()), plannerModel, SLOT(cancelPlan())); + QShortcut *closeKey = new QShortcut(QKeySequence(Qt::Key_Escape), this); + connect(closeKey, SIGNAL(activated()), plannerModel, SLOT(cancelPlan())); /* set defaults. */ ui.startTime->setTime(QTime(1, 0)); -- cgit v1.2.3-70-g09d2