Allow opening summary plot editor from context menu when multiple cases are selected in data sources

This commit is contained in:
Jon Jenssen 2022-09-13 12:06:25 +02:00 committed by jonjenssen
parent 19cfd191ae
commit 1edbd5fea8

View File

@ -55,6 +55,12 @@ bool RicOpenSummaryPlotEditorFeature::isCommandEnabled()
RimSummaryMultiPlot* multiPlot = nullptr;
RimCustomObjectiveFunctionCollection* customObjFuncCollection = nullptr;
std::vector<RimSummaryCase*> selectedCases = caf::selectedObjectsByType<RimSummaryCase*>();
if ( selectedCases.size() > 0 ) return true;
std::vector<RimSummaryCaseCollection*> selectedGroups = caf::selectedObjectsByType<RimSummaryCaseCollection*>();
if ( selectedGroups.size() > 0 ) return true;
caf::PdmObject* selObj = dynamic_cast<caf::PdmObject*>( caf::SelectionManager::instance()->selectedItem() );
if ( !selObj ) return false;