#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

@@ -39,6 +39,8 @@ void RicCloseProjectFeature::onActionTriggered(bool isChecked)
{
RiaApplication* app = RiaApplication::instance();
if (!app->askUserToSaveModifiedProject()) return;
app->closeProject();
}

View File

@@ -41,6 +41,9 @@ bool RicOpenLastUsedFileFeature::isCommandEnabled()
void RicOpenLastUsedFileFeature::onActionTriggered(bool isChecked)
{
RiaApplication* app = RiaApplication::instance();
if (!app->askUserToSaveModifiedProject()) return;
QString fileName = app->preferences()->lastUsedProjectFileName;
if (app->loadProject(fileName))

View File

@@ -42,6 +42,9 @@ bool RicOpenProjectFeature::isCommandEnabled()
void RicOpenProjectFeature::onActionTriggered(bool isChecked)
{
RiaApplication* app = RiaApplication::instance();
if (!app->askUserToSaveModifiedProject()) return;
QString defaultDir = app->lastUsedDialogDirectory("BINARY_GRID");
QString fileName = QFileDialog::getOpenFileName(NULL, "Open ResInsight Project", defaultDir, "ResInsight project (*.rsp *.rip);;All files(*.*)");