mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3720 Temp LGR. Hide 'Temporary LGRs' tree node when no temp LGRs exist
This commit is contained in:
parent
094ae45dcd
commit
651084420c
@ -476,7 +476,10 @@ void RimGridCollection::defineUiTreeOrdering(caf::PdmUiTreeOrdering& uiTreeOrder
|
||||
{
|
||||
uiTreeOrdering.add(m_persistentLgrs());
|
||||
}
|
||||
uiTreeOrdering.add(m_temporaryLgrs());
|
||||
if (hasTemporaryLgrs())
|
||||
{
|
||||
uiTreeOrdering.add(m_temporaryLgrs());
|
||||
}
|
||||
uiTreeOrdering.skipRemainingChildren(true);
|
||||
}
|
||||
|
||||
@ -505,3 +508,20 @@ bool RimGridCollection::hasPersistentLgrs() const
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGridCollection::hasTemporaryLgrs() const
|
||||
{
|
||||
auto mainGrid = this->mainGrid();
|
||||
if (!mainGrid) return false;
|
||||
|
||||
for (size_t i = 1; i < mainGrid->gridCount(); i++)
|
||||
{
|
||||
const auto grid = mainGrid->gridByIndex(i);
|
||||
if (grid->isTempGrid()) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,7 @@ protected:
|
||||
private:
|
||||
const RigMainGrid* mainGrid() const;
|
||||
bool hasPersistentLgrs() const;
|
||||
bool hasTemporaryLgrs() const;
|
||||
|
||||
caf::PdmField<bool> m_isActive;
|
||||
caf::PdmChildField<RimGridInfo*> m_mainGrid;
|
||||
|
Loading…
Reference in New Issue
Block a user