From 249a1ac1702746dc009d31aad648af08cc11bb7a Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Thu, 4 Jul 2013 12:58:11 -0300 Subject: Added a messageBox when the planner quits with a working plan. Added a messageBox to warn the user that he quit with a working plan, to reduce the risk of unwanted loss of work. Signed-off-by: Tomaz Canabrava --- qt-ui/diveplanner.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index f9420be2c..1cabdfacf 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "ui_diveplanner.h" #include "mainwindow.h" @@ -262,6 +263,13 @@ qreal DivePlannerGraphics::fromPercent(qreal percent, Qt::Orientation orientatio void DivePlannerGraphics::cancelClicked() { + if (handles.size()){ + if (QMessageBox::warning(mainWindow(), tr("Save the Plan?"), + tr("You have a working plan, \n are you sure that you wanna cancel it?"), + QMessageBox::Ok | QMessageBox::Cancel) != QMessageBox::Ok){ + return; + } + } mainWindow()->showProfile(); } -- cgit v1.2.3-70-g09d2