mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2023 SSI-hub: Create ResInsight project at well path download
This commit is contained in:
parent
3611d32e9e
commit
b7865aea95
@ -32,6 +32,7 @@
|
||||
#include <QAction>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QMessageBox>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicWellPathsImportSsihubFeature, "RicWellPathsImportSsihubFeature");
|
||||
|
||||
@ -41,17 +42,6 @@ CAF_CMD_SOURCE_INIT(RicWellPathsImportSsihubFeature, "RicWellPathsImportSsihubFe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicWellPathsImportSsihubFeature::isCommandEnabled()
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
if (!app->project())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!caf::Utils::fileExists(app->project()->fileName()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -63,8 +53,33 @@ void RicWellPathsImportSsihubFeature::onActionTriggered(bool isChecked)
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
if (!app->project()) return;
|
||||
|
||||
if (!caf::Utils::fileExists(app->project()->fileName())) return;
|
||||
if (!caf::Utils::fileExists(app->project()->fileName()))
|
||||
{
|
||||
RiaGuiApplication* guiApp = RiaGuiApplication::instance();
|
||||
if (guiApp)
|
||||
{
|
||||
QMessageBox msgBox(guiApp->mainWindow());
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
|
||||
QString questionText = QString("Import of well paths will be stored as a part of a ResInsight project file. Please "
|
||||
"save the project to file before importing well paths.");
|
||||
|
||||
msgBox.setText(questionText);
|
||||
msgBox.setInformativeText("Do you want to save the project?");
|
||||
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
|
||||
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
{
|
||||
guiApp->saveProject();
|
||||
}
|
||||
}
|
||||
|
||||
if (!caf::Utils::fileExists(app->project()->fileName()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Update the UTM bounding box from the reservoir
|
||||
app->project()->computeUtmAreaOfInterest();
|
||||
|
Loading…
Reference in New Issue
Block a user