BIM: prevent user to remove core properties

This commit is contained in:
Florian Foinant-Willig
2025-03-16 20:50:02 +01:00
committed by Kacper Donat
parent d5e2fdf8fd
commit 8a4c61ec5a
43 changed files with 568 additions and 551 deletions

View File

@@ -73,13 +73,13 @@ class ArchReference:
pl = obj.PropertiesList
if not "File" in pl:
t = QT_TRANSLATE_NOOP("App::Property","The base file this component is built upon")
obj.addProperty("App::PropertyFile","File","Reference",t)
obj.addProperty("App::PropertyFile","File","Reference",t, locked=True)
if not "Part" in pl:
t = QT_TRANSLATE_NOOP("App::Property","The part to use from the base file")
obj.addProperty("App::PropertyString","Part","Reference",t)
obj.addProperty("App::PropertyString","Part","Reference",t, locked=True)
if not "ReferenceMode" in pl:
t = QT_TRANSLATE_NOOP("App::Property","The way the referenced objects are included in the current document. 'Normal' includes the shape, 'Transient' discards the shape when the object is switched off (smaller filesize), 'Lightweight' does not import the shape but only the OpenInventor representation")
obj.addProperty("App::PropertyEnumeration","ReferenceMode","Reference",t)
obj.addProperty("App::PropertyEnumeration","ReferenceMode","Reference",t, locked=True)
obj.ReferenceMode = ["Normal","Transient","Lightweight"]
if "TransientReference" in pl:
if obj.TransientReference:
@@ -89,7 +89,7 @@ class ArchReference:
FreeCAD.Console.PrintMessage(translate("Arch","Upgrading")+" "+obj.Label+" "+t+"\n")
if not "FuseArch" in pl:
t = QT_TRANSLATE_NOOP("App::Property","Fuse objects of same material")
obj.addProperty("App::PropertyBool","FuseArch", "Reference", t)
obj.addProperty("App::PropertyBool","FuseArch", "Reference", t, locked=True)
self.Type = "Reference"
@@ -526,11 +526,11 @@ class ViewProviderArchReference:
pl = vobj.PropertiesList
if not "TimeStamp" in pl:
t = QT_TRANSLATE_NOOP("App::Property","The latest time stamp of the linked file")
vobj.addProperty("App::PropertyFloat","TimeStamp","Reference",t)
vobj.addProperty("App::PropertyFloat","TimeStamp","Reference",t, locked=True)
vobj.setEditorMode("TimeStamp",2)
if not "UpdateColors" in pl:
t = QT_TRANSLATE_NOOP("App::Property","If true, the colors from the linked file will be kept updated")
vobj.addProperty("App::PropertyBool","UpdateColors","Reference",t)
vobj.addProperty("App::PropertyBool","UpdateColors","Reference",t, locked=True)
vobj.UpdateColors = True