aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-07-04 12:58:11 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-07-04 12:58:11 -0300
commit249a1ac1702746dc009d31aad648af08cc11bb7a (patch)
treeede9329b182cb8c3ae6f030fc70d4316d0fc7088 /qt-ui
parentbb33be4117fa1f5e753d07ac530c3d378d4f0dd0 (diff)
downloadsubsurface-249a1ac1702746dc009d31aad648af08cc11bb7a.tar.gz
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 <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/diveplanner.cpp8
1 files changed, 8 insertions, 0 deletions
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 <QGraphicsProxyWidget>
#include <QPushButton>
#include <QGraphicsSceneMouseEvent>
+#include <QMessageBox>
#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();
}