mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Don't quit while dive is edited
If the user edits a dive and then quits we try to ask them to finish editing, first. If the user did this by either clicking the little 'x' in the window decoration or by hitting Alt-F4 (or similar), we didn't have that question (only the 'save changes' question in case the dive list had already been modified. Fixes #374 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
397898434e
commit
fe88a2a476
1 changed files with 7 additions and 0 deletions
|
@ -700,6 +700,13 @@ void MainWindow::writeSettings()
|
|||
|
||||
void MainWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if(DivePlannerPointsModel::instance()->currentMode() != DivePlannerPointsModel::NOTHING ||
|
||||
ui.InfoWidget->isEditing()) {
|
||||
QMessageBox::warning(this, tr("Warning"), tr("Please save or cancel the current dive edit before closing the file."));
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
|
||||
if (helpView && helpView->isVisible()){
|
||||
helpView->close();
|
||||
helpView->deleteLater();
|
||||
|
|
Loading…
Reference in a new issue