DocumentObject: add allowDuplicateLabel/onBeforeChangeLabel()
These two APIs allow an object to control its own labeling rules. The previous auto re-labeling for uniqueness logic is moved from ObjectLabelObserver (resides in Application.cpp) to PropertyString. DocumentObject::allowDuplicateLabel() is used to inform PropertyString that the object allows duplicate label regardless of application setting. onBeforeChangeLabel() is called before actual label change to give object a chance to override the new label.
This commit is contained in:
@@ -262,5 +262,11 @@ or None if the GUI is not up</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="Parents" Type="List"/>
|
||||
</Attribute>
|
||||
<Attribute Name="OldLabel" ReadOnly="true">
|
||||
<Documentation>
|
||||
<UserDocu>Contains the old label before change</UserDocu>
|
||||
</Documentation>
|
||||
<Parameter Name="OldLabel" Type="String"/>
|
||||
</Attribute>
|
||||
</PythonExport>
|
||||
</GenerateModel>
|
||||
|
||||
Reference in New Issue
Block a user