Select last imported wellPath on import, not last wellPath in collection

This commit is contained in:
Rebecca Cox
2017-11-12 21:57:25 +01:00
parent 3e40331c5b
commit a4484579e2
3 changed files with 19 additions and 2 deletions

View File

@@ -70,8 +70,16 @@ void RicWellPathsImportFileFeature::onActionTriggered(bool isChecked)
if (oilField->wellPathCollection->wellPaths().size() > 0)
{
RimWellPath* wellPath = oilField->wellPathCollection->wellPaths()[oilField->wellPathCollection->wellPaths().size() - 1];
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);
RimWellPath* wellPath = nullptr;
QString wellPathName = oilField->wellPathCollection->newestAddedWellName();
wellPath = oilField->wellPathCollection->wellPathByName(wellPathName);
if (wellPath)
{
RiuMainWindow::instance()->selectAsCurrentItem(wellPath);
}
}
}
}