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:
@@ -834,3 +834,7 @@ PyObject *DocumentObjectPy::adjustRelativeLinks(PyObject *args) {
|
||||
PyObject_IsTrue(recursive)?&visited:nullptr)));
|
||||
}PY_CATCH
|
||||
}
|
||||
|
||||
Py::String DocumentObjectPy::getOldLabel() const {
|
||||
return Py::String(getDocumentObjectPtr()->getOldLabel());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user