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>
This commit is contained in:
Tomaz Canabrava 2013-07-04 12:58:11 -03:00
parent bb33be4117
commit 249a1ac170

View file

@ -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();
}