mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-27 05:37:21 -05:00
#14101 Make Fault Distance objects deletable
Enable the standard tree Delete action on RimFaultDistance via setDeletable( true ). On deletion, remove the generated FAULTDIST result from the case in the destructor; the object is still attached to the project tree while the destructor body runs, so the owner case is reachable.
This commit is contained in:
committed by
Magne Sjaastad
parent
12cd173c62
commit
a90e7bb26a
@@ -59,6 +59,17 @@ RimFaultDistance::RimFaultDistance()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_generateButton, "Generate", "" );
|
||||
caf::PdmUiPushButtonEditor::configureEditorLabelLeft( &m_generateButton );
|
||||
|
||||
setDeletable( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Remove the generated result from the case when the object is deleted. The object is still
|
||||
/// attached to the project tree while this destructor body runs, so the owner case is reachable.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFaultDistance::~RimFaultDistance()
|
||||
{
|
||||
removeGeneratedResult( m_resultName() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -43,6 +43,7 @@ class RimFaultDistance : public caf::PdmObject
|
||||
|
||||
public:
|
||||
RimFaultDistance();
|
||||
~RimFaultDistance() override;
|
||||
|
||||
QString resultName() const;
|
||||
void setResultName( const QString& name );
|
||||
|
||||
Reference in New Issue
Block a user