Extensions: Add changed property handling
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
|
||||
#include "PropertyContainer.h"
|
||||
#include "PropertyPythonObject.h"
|
||||
#include "ExtensionContainer.h"
|
||||
#include "Base/Interpreter.h"
|
||||
#include <CXX/Objects.hxx>
|
||||
|
||||
@@ -253,6 +254,9 @@ protected:
|
||||
Base::Type::instantiationMethod method=0);
|
||||
//@}
|
||||
|
||||
virtual void extensionOnChanged(const Property* p) {(void)(p);};
|
||||
|
||||
friend class App::ExtensionContainer;
|
||||
|
||||
protected:
|
||||
void initExtension(Base::Type type);
|
||||
|
||||
@@ -265,17 +265,11 @@ const char* ExtensionContainer::getPropertyDocumentation(const char* name) const
|
||||
}
|
||||
|
||||
void ExtensionContainer::onChanged(const Property* prop) {
|
||||
/*
|
||||
//we need to make sure that the proxy we use is always the proxy of the extended class. This
|
||||
//is needed as only the extended class proxy (either c++ or python) is managed and ensured to
|
||||
//be the python implementation class
|
||||
//Note: this property only exist if the created object is FeaturePythonT<>, this won't work for
|
||||
//any default document object. But this doesnt matter much as there is a proxy object set anyway
|
||||
//if a extension gets registered from python. This is only for synchronisation.
|
||||
if(strcmp(prop->getName(), "Proxy")) {
|
||||
for(auto entry : _extensions)
|
||||
entry.second->extensionGetExtensionPyObject().setValue(static_cast<const PropertyPythonObject*>(prop)->getValue());
|
||||
}*/
|
||||
|
||||
//inform all extensions about changed property. This includes all properties from the
|
||||
//extended object (this) as well as all extension properties
|
||||
for(auto entry : _extensions)
|
||||
entry.second->extensionOnChanged(prop);
|
||||
|
||||
App::PropertyContainer::onChanged(prop);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user