bool hasCompositeOwner = false;
bool hasResultInHistory = false;
bool hasFolder = false;
+ bool canBeDeleted = true;
ModuleBase_Tools::checkObjects(aObjects, hasResult, hasFeature, hasParameter,
hasCompositeOwner, hasResultInHistory, hasFolder);
//Process Feature
if( aMgr->activeDocument() == aObject->document() )
{
action("RENAME_CMD")->setEnabled(true);
- action("DELETE_CMD")->setEnabled(!hasCompositeOwner);
+ if (aObject->groupName() == ModelAPI_ResultConstruction::group()) {
+ FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
+ canBeDeleted = aFeature->isInHistory();
+ action("DELETE_CMD")->setEnabled(canBeDeleted);
+ }
+ else
+ action("DELETE_CMD")->setEnabled(!hasCompositeOwner);
action("CLEAN_HISTORY_CMD")->setEnabled(!hasCompositeOwner &&
(hasFeature || hasParameter));
}
break;
}
if (!hasCompositeOwner && allActive ) {
- if (hasResult || hasFeature || hasParameter) // #2924 results can be erased
- action("DELETE_CMD")->setEnabled(true);
+ if (hasResult || hasFeature || hasParameter) // #2924 results can be erased
+ action("DELETE_CMD")->setEnabled(canBeDeleted);
}
if (!hasCompositeOwner && allActive && (hasFeature|| hasParameter))
action("CLEAN_HISTORY_CMD")->setEnabled(true);
ObjectPtr aObject;
foreach(ModuleBase_ViewerPrsPtr aPrs, aPrsList) {
aObject = aPrs->object();
+ if (!aObject.get())
+ continue;
GeomShapePtr aShape = aPrs->shape();
if (aObject->isDisplayed()) {
isVisible = true;