Closing the window should behave like triggering Quit

It seems odd to have different behavior depending on whether the window
manager tells us that the user wants to close the window or whether the
user hits quit or ctrl-q.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-06-03 18:22:22 -07:00
parent a82411b67c
commit b6fce3f556

View file

@ -802,7 +802,7 @@ 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."));
on_actionQuit_triggered();
event->ignore();
return;
}