mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2027 Select Well path on well path import
This commit is contained in:
parent
ead75326e1
commit
1775045248
@ -20,7 +20,12 @@
|
|||||||
#include "RicWellPathsImportFileFeature.h"
|
#include "RicWellPathsImportFileFeature.h"
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
#include "RiaApplication.h"
|
||||||
|
|
||||||
|
#include "RimOilField.h"
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
|
#include "RimWellPath.h"
|
||||||
|
#include "RimWellPathCollection.h"
|
||||||
|
|
||||||
#include "RiuMainWindow.h"
|
#include "RiuMainWindow.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
@ -53,10 +58,25 @@ void RicWellPathsImportFileFeature::onActionTriggered(bool isChecked)
|
|||||||
app->setLastUsedDialogDirectory("WELLPATH_DIR", QFileInfo(wellPathFilePaths.last()).absolutePath());
|
app->setLastUsedDialogDirectory("WELLPATH_DIR", QFileInfo(wellPathFilePaths.last()).absolutePath());
|
||||||
|
|
||||||
app->addWellPathsToModel(wellPathFilePaths);
|
app->addWellPathsToModel(wellPathFilePaths);
|
||||||
if (app->project())
|
|
||||||
|
RimProject* project = app->project();
|
||||||
|
|
||||||
|
if (project)
|
||||||
{
|
{
|
||||||
app->project()->createDisplayModelAndRedrawAllViews();
|
project->createDisplayModelAndRedrawAllViews();
|
||||||
|
RimOilField* oilField = project->activeOilField();
|
||||||
|
|
||||||
|
if (!oilField) return;
|
||||||
|
|
||||||
|
size_t lastIdx = oilField->wellPathCollection->wellPaths().size() - 1;
|
||||||
|
if (lastIdx >= 0)
|
||||||
|
{
|
||||||
|
RimWellPath* wellPath = oilField->wellPathCollection->wellPaths()[lastIdx];
|
||||||
|
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user