mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1401 Ask user to save modified project before project close
This commit is contained in:
@@ -39,6 +39,8 @@ void RicCloseProjectFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
|
||||
if (!app->askUserToSaveModifiedProject()) return;
|
||||
|
||||
app->closeProject();
|
||||
}
|
||||
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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(*.*)");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user