mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5047 Remove input property collection from project tree.
This commit is contained in:
parent
c042aec22a
commit
3fafe90aeb
@ -40,8 +40,7 @@ CAF_CMD_SOURCE_INIT( RicAddEclipseInputPropertyFeature, "RicAddEclipseInputPrope
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicAddEclipseInputPropertyFeature::isCommandEnabled()
|
||||
{
|
||||
return caf::SelectionManager::instance()->selectedItemOfType<RimEclipseInputPropertyCollection>() ||
|
||||
caf::SelectionManager::instance()->selectedItemOfType<RimEclipseInputCase>() ||
|
||||
return caf::SelectionManager::instance()->selectedItemOfType<RimEclipseInputCase>() ||
|
||||
caf::SelectionManager::instance()->selectedItemOfType<RimEclipseResultCase>();
|
||||
}
|
||||
|
||||
@ -50,26 +49,11 @@ bool RicAddEclipseInputPropertyFeature::isCommandEnabled()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicAddEclipseInputPropertyFeature::onActionTriggered( bool isChecked )
|
||||
{
|
||||
RimEclipseCase* eclipseCase = nullptr;
|
||||
RimEclipseCase* eclipseCase = caf::SelectionManager::instance()->selectedItemOfType<RimEclipseCase>();
|
||||
if ( !eclipseCase ) return;
|
||||
|
||||
RimEclipseInputPropertyCollection* inputPropertyCollection =
|
||||
caf::SelectionManager::instance()->selectedItemOfType<RimEclipseInputPropertyCollection>();
|
||||
if ( !inputPropertyCollection )
|
||||
{
|
||||
// No property collection selected: triggered from RimEclipseInputCase/RimEclipseResultCase.
|
||||
eclipseCase = caf::SelectionManager::instance()->selectedItemOfType<RimEclipseCase>();
|
||||
if ( eclipseCase )
|
||||
{
|
||||
inputPropertyCollection = eclipseCase->inputPropertyCollection();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Triggered from collection: get eclipse case ancestor
|
||||
inputPropertyCollection->firstAncestorOrThisOfTypeAsserted( eclipseCase );
|
||||
}
|
||||
|
||||
if ( !inputPropertyCollection || !eclipseCase ) return;
|
||||
RimEclipseInputPropertyCollection* inputPropertyCollection = eclipseCase->inputPropertyCollection();
|
||||
if ( !inputPropertyCollection ) return;
|
||||
|
||||
QFileInfo fi( eclipseCase->gridFileName() );
|
||||
QString casePath = fi.absolutePath();
|
||||
|
@ -41,7 +41,6 @@
|
||||
#include "RimEclipseContourMapView.h"
|
||||
#include "RimEclipseContourMapViewCollection.h"
|
||||
#include "RimEclipseInputProperty.h"
|
||||
#include "RimEclipseInputPropertyCollection.h"
|
||||
#include "RimEclipsePropertyFilter.h"
|
||||
#include "RimEclipsePropertyFilterCollection.h"
|
||||
#include "RimEclipseStatisticsCase.h"
|
||||
@ -255,10 +254,6 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
||||
menuBuilder << "RicSaveEclipseInputVisibleCellsFeature";
|
||||
menuBuilder << "RicCreateGridCrossPlotFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimEclipseInputPropertyCollection*>( uiItem ) )
|
||||
{
|
||||
menuBuilder << "RicAddEclipseInputPropertyFeature";
|
||||
}
|
||||
else if ( dynamic_cast<RimEclipseInputProperty*>( uiItem ) )
|
||||
{
|
||||
menuBuilder << "RicSaveEclipseInputPropertyFeature";
|
||||
|
@ -550,11 +550,6 @@ void RimEclipseCase::defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrderin
|
||||
uiTreeOrdering.add( &m_contourMapCollection );
|
||||
}
|
||||
|
||||
if ( !m_inputPropertyCollection->inputProperties.empty() )
|
||||
{
|
||||
uiTreeOrdering.add( &m_inputPropertyCollection );
|
||||
}
|
||||
|
||||
uiTreeOrdering.skipRemainingChildren( true );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user