mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1813 Observed data: Remove right click options if any object in selection is an observed data
This commit is contained in:
parent
1eecef9f72
commit
fe1dfebea2
@ -77,7 +77,19 @@ bool RicCloseSummaryCaseFeature::isCommandEnabled()
|
||||
std::vector<RimSummaryCase*> selection;
|
||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||
|
||||
return (selection.size() > 0 && !selection[0]->isObservedData());
|
||||
if (selection.size() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (RimSummaryCase* summaryCase : selection)
|
||||
{
|
||||
if (summaryCase->isObservedData())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -37,7 +37,19 @@ bool RicCreateSummaryCaseCollectionFeature::isCommandEnabled()
|
||||
std::vector<RimSummaryCase*> selection;
|
||||
caf::SelectionManager::instance()->objectsByType(&selection);
|
||||
|
||||
return (selection.size() > 0 && !selection[0]->isObservedData());
|
||||
if (selection.size() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (RimSummaryCase* summaryCase : selection)
|
||||
{
|
||||
if (summaryCase->isObservedData())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -43,7 +43,20 @@ bool RicReloadSummaryCaseFeature::isCommandEnabled()
|
||||
{
|
||||
std::vector<RimSummaryCase*> caseSelection = selectedSummaryCases();
|
||||
|
||||
return (caseSelection.size() > 0 && !caseSelection[0]->isObservedData());
|
||||
if (caseSelection.size() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (RimSummaryCase* summaryCase : caseSelection)
|
||||
{
|
||||
if (summaryCase->isObservedData())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -57,7 +57,19 @@ bool RicPasteSummaryCaseFeature::isCommandEnabled()
|
||||
|
||||
std::vector<caf::PdmPointer<RimSummaryCase> > summaryCases = RicPasteSummaryCaseFeature::summaryCases();
|
||||
|
||||
return (summaryCases.size() > 0 && !summaryCases[0]->isObservedData());
|
||||
if (summaryCases.size() == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (RimSummaryCase* summaryCase : summaryCases)
|
||||
{
|
||||
if (summaryCase->isObservedData())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user