mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Select last imported wellPath on import, not last wellPath in collection
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,6 +96,7 @@ RimWellPathCollection::RimWellPathCollection()
|
||||
wellPaths.uiCapability()->setUiHidden(true);
|
||||
|
||||
m_wellPathImporter = new RifWellPathImporter;
|
||||
m_newestAddedWellName = QString();
|
||||
}
|
||||
|
||||
|
||||
@@ -273,6 +274,11 @@ void RimWellPathCollection::readAndAddWellPaths(std::vector<RimWellPath*>& wellP
|
||||
progress.incrementProgress();
|
||||
}
|
||||
|
||||
if (!wellPathArray.empty())
|
||||
{
|
||||
m_newestAddedWellName = wellPathArray.back()->name();
|
||||
}
|
||||
|
||||
this->sortWellsByName();
|
||||
}
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ public:
|
||||
|
||||
void setProject(RimProject* project);
|
||||
|
||||
QString newestAddedWellName() { return m_newestAddedWellName; }
|
||||
|
||||
enum WellVisibilityType
|
||||
{
|
||||
FORCE_ALL_OFF,
|
||||
@@ -129,4 +131,5 @@ private:
|
||||
RiaEclipseUnitTools::UnitSystemType findUnitSystemForWellPath(const RimWellPath* wellPath);
|
||||
|
||||
RifWellPathImporter* m_wellPathImporter;
|
||||
QString m_newestAddedWellName;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user