mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
bb33be4117
commit
249a1ac170
1 changed files with 8 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
||||||
#include <QGraphicsProxyWidget>
|
#include <QGraphicsProxyWidget>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
#include "ui_diveplanner.h"
|
#include "ui_diveplanner.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
@ -262,6 +263,13 @@ qreal DivePlannerGraphics::fromPercent(qreal percent, Qt::Orientation orientatio
|
||||||
|
|
||||||
void DivePlannerGraphics::cancelClicked()
|
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();
|
mainWindow()->showProfile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue