Draft: Prevent user to remove core properties

This commit is contained in:
Florian Foinant-Willig
2025-03-16 22:21:44 +01:00
committed by Kacper Donat
parent 8a4c61ec5a
commit 36b8e9a703
34 changed files with 386 additions and 250 deletions

View File

@@ -100,7 +100,8 @@ class DraftLink(DraftObject):
obj.addProperty("App::PropertyBool",
"AlwaysSyncPlacement",
"Draft",
_tip)
_tip,
locked=True)
if hasattr(obj, 'ShowElement'):
# Rename 'ShowElement' property to 'ExpandArray' to avoid conflict
@@ -113,7 +114,8 @@ class DraftLink(DraftObject):
obj.addProperty("App::PropertyBool",
"ExpandArray",
"Draft",
_tip)
_tip,
locked=True)
obj.ExpandArray = showElement
obj.configLinkProperty(ShowElement='ExpandArray')
@@ -129,16 +131,18 @@ class DraftLink(DraftObject):
if not hasattr(obj, 'LinkTransform'):
obj.addProperty('App::PropertyBool',
'LinkTransform',
' Link')
' Link',
locked=True)
if not hasattr(obj, 'ColoredElements'):
obj.addProperty('App::PropertyLinkSubHidden',
'ColoredElements',
' Link')
' Link',
locked=True)
obj.setPropertyStatus('ColoredElements', 'Hidden')
if not hasattr(obj,'LinkCopyOnChange'):
obj.addProperty("App::PropertyEnumeration","LinkCopyOnChange"," Link")
obj.addProperty("App::PropertyEnumeration","LinkCopyOnChange"," Link",locked=True)
obj.configLinkProperty('LinkCopyOnChange','LinkTransform','ColoredElements')