mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-27 05:37:21 -05:00
#14101 Show case-level Data Analytics folder when first Fault Distance is created
The Data Analytics folder is built in RimEclipseCase::defineUiTreeOrdering and is hidden while the fault distance collection is empty. Adding the first result only refreshed the view (or the collection itself), not the case, so the case tree ordering was never re-run and the folder stayed hidden until an unrelated event rebuilt the tree. Refresh the owner case from the collection whenever items change, mirroring the RimDataFilterCollection precedent. onItemsChanged adds the folder when the first result appears, and onChildDeleted removes it when the last result is deleted.
This commit is contained in:
committed by
Magne Sjaastad
parent
c2b4f83643
commit
6681ba566f
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "RimFaultDistanceCollection.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimFaultDistance.h"
|
||||
|
||||
#include "cafCmdFeatureMenuBuilder.h"
|
||||
@@ -93,3 +94,23 @@ void RimFaultDistanceCollection::appendMenuItems( caf::CmdFeatureMenuBuilder& me
|
||||
{
|
||||
menuBuilder << "RicNewFaultDistanceResultFeature";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// The case-level "Data Analytics" folder is hidden from the tree while this collection is empty, so
|
||||
/// refresh the owner case to re-run its defineUiTreeOrdering and add/remove the folder when the first
|
||||
/// item appears or the last item is removed.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaultDistanceCollection::onItemsChanged()
|
||||
{
|
||||
if ( auto* eclipseCase = firstAncestorOrThisOfType<RimEclipseCase>() ) eclipseCase->updateConnectedEditors();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaultDistanceCollection::onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& referringObjects )
|
||||
{
|
||||
updateConnectedEditors();
|
||||
|
||||
if ( auto* eclipseCase = firstAncestorOrThisOfType<RimEclipseCase>() ) eclipseCase->updateConnectedEditors();
|
||||
}
|
||||
|
||||
@@ -45,4 +45,7 @@ public:
|
||||
private:
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName ) override;
|
||||
void appendMenuItems( caf::CmdFeatureMenuBuilder& menuBuilder ) const override;
|
||||
|
||||
void onItemsChanged() override;
|
||||
void onChildDeleted( caf::PdmChildArrayFieldHandle* childArray, std::vector<caf::PdmObjectHandle*>& referringObjects ) override;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user