From 177504524847b8135078f999ac4c30d7b70b6498 Mon Sep 17 00:00:00 2001 From: Rebecca Cox Date: Fri, 20 Oct 2017 12:40:06 +0200 Subject: [PATCH] #2027 Select Well path on well path import --- .../RicWellPathsImportFileFeature.cpp | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.cpp b/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.cpp index fc313108fd..a6ee5e14ad 100644 --- a/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.cpp +++ b/ApplicationCode/Commands/WellPathCommands/RicWellPathsImportFileFeature.cpp @@ -20,7 +20,12 @@ #include "RicWellPathsImportFileFeature.h" #include "RiaApplication.h" + +#include "RimOilField.h" #include "RimProject.h" +#include "RimWellPath.h" +#include "RimWellPathCollection.h" + #include "RiuMainWindow.h" #include @@ -53,10 +58,25 @@ void RicWellPathsImportFileFeature::onActionTriggered(bool isChecked) app->setLastUsedDialogDirectory("WELLPATH_DIR", QFileInfo(wellPathFilePaths.last()).absolutePath()); 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); + } + } + } //--------------------------------------------------------------------------------------------------