#1813 Observed data: Remove right click options for observed data

This commit is contained in:
Rebecca Cox 2017-09-19 10:27:54 +02:00
parent 28c86b08d7
commit 4e82aaf502
5 changed files with 12 additions and 7 deletions

View File

@ -110,9 +110,12 @@ bool RicCutReferencesToClipboardFeature::isAnyCuttableObjectSelected()
//--------------------------------------------------------------------------------------------------
bool RicCutReferencesToClipboardFeature::isCuttingOfObjectSupported(caf::PdmObject* pdmObject)
{
if (dynamic_cast<RimSummaryCase*>(pdmObject))
if (RimSummaryCase* summaryCase = dynamic_cast<RimSummaryCase*>(pdmObject))
{
return true;
if (!summaryCase->isObservedData())
{
return true;
}
}
return false;

View File

@ -77,7 +77,7 @@ bool RicCloseSummaryCaseFeature::isCommandEnabled()
std::vector<RimSummaryCase*> selection;
caf::SelectionManager::instance()->objectsByType(&selection);
return (selection.size() > 0);
return (selection.size() > 0 && !selection[0]->isObservedData());
}
//--------------------------------------------------------------------------------------------------

View File

@ -35,9 +35,9 @@ CAF_CMD_SOURCE_INIT(RicCreateSummaryCaseCollectionFeature, "RicCreateSummaryCase
bool RicCreateSummaryCaseCollectionFeature::isCommandEnabled()
{
std::vector<RimSummaryCase*> selection;
caf::SelectionManager::instance()->objectsByType(&selection);
caf::SelectionManager::instance()->objectsByType(&selection);
return (selection.size() > 0);
return (selection.size() > 0 && !selection[0]->isObservedData());
}
//--------------------------------------------------------------------------------------------------

View File

@ -43,7 +43,7 @@ bool RicReloadSummaryCaseFeature::isCommandEnabled()
{
std::vector<RimSummaryCase*> caseSelection = selectedSummaryCases();
return (caseSelection.size() > 0);
return (caseSelection.size() > 0 && !caseSelection[0]->isObservedData());
}
//--------------------------------------------------------------------------------------------------

View File

@ -55,7 +55,9 @@ bool RicPasteSummaryCaseFeature::isCommandEnabled()
return false;
}
return RicPasteSummaryCaseFeature::summaryCases().size() > 0;
std::vector<caf::PdmPointer<RimSummaryCase> > summaryCases = RicPasteSummaryCaseFeature::summaryCases();
return (summaryCases.size() > 0 && !summaryCases[0]->isObservedData());
}
//--------------------------------------------------------------------------------------------------