#1401 Ask user to save modified project before project close

This commit is contained in:
Magne Sjaastad
2017-04-20 08:07:47 +02:00
parent 82b6e4b8f2
commit d7d80bc53e
8 changed files with 99 additions and 14 deletions

View File

@@ -197,15 +197,18 @@ void RiuMainWindow::cleanupGuiBeforeProjectClose()
//--------------------------------------------------------------------------------------------------
void RiuMainWindow::closeEvent(QCloseEvent* event)
{
saveWinGeoAndDockToolBarLayout();
RiaApplication* app = RiaApplication::instance();
if (!app->askUserToSaveModifiedProject())
{
event->ignore();
return;
}
saveWinGeoAndDockToolBarLayout();
if (!app->tryClosePlotWindow()) return;
RiaApplication::instance()->closeProject();
event->accept();
app->closeProject();
}
//--------------------------------------------------------------------------------------------------