mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-10 23:46:00 -06:00
#3607 Grid items. Hide LGRs folder if there are no LGRs on file
This commit is contained in:
parent
0a9f00248b
commit
551bf099d3
@ -463,7 +463,10 @@ void RimGridCollection::initAfterRead()
|
||||
void RimGridCollection::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName /*= ""*/)
|
||||
{
|
||||
uiTreeOrdering.add(m_mainGrid());
|
||||
uiTreeOrdering.add(m_persistentLgrs());
|
||||
if (hasPersistentLgrs())
|
||||
{
|
||||
uiTreeOrdering.add(m_persistentLgrs());
|
||||
}
|
||||
uiTreeOrdering.add(m_temporaryLgrs());
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
@ -477,3 +480,19 @@ const RigMainGrid* RimGridCollection::mainGrid() const
|
||||
firstAncestorOrThisOfType(eclipseCase);
|
||||
return eclipseCase ? eclipseCase->mainGrid() : nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGridCollection::hasPersistentLgrs() const
|
||||
{
|
||||
auto mainGrid = this->mainGrid();
|
||||
if (!mainGrid) return 0;
|
||||
|
||||
for (int i = 1; i < mainGrid->gridCount(); i++)
|
||||
{
|
||||
const auto grid = mainGrid->gridByIndex(i);
|
||||
if (!grid->isTempGrid()) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -116,6 +116,7 @@ protected:
|
||||
|
||||
private:
|
||||
const RigMainGrid* mainGrid() const;
|
||||
bool hasPersistentLgrs() const;
|
||||
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmChildField<RimGridInfo*> m_mainGrid;
|
||||
|
Loading…
Reference in New Issue
Block a user