Changing a per-object setting now forces a re-slice

CURA-1278
This commit is contained in:
Jaime van Kessel 2016-06-02 14:42:48 +02:00
parent 2abbb5c9a1
commit 388a345140

View File

@ -18,11 +18,17 @@ class SettingOverrideDecorator(SceneNodeDecorator):
self._instance = InstanceContainer(container_id = "SettingOverrideInstanceContainer")
self._stack.addContainer(self._instance)
self._stack.propertyChanged.connect(self._onSettingChanged)
ContainerRegistry.getInstance().addContainer(self._stack)
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerStackChanged)
self._onGlobalContainerStackChanged()
def _onSettingChanged(self, instance, property):
if property == "value": # Only reslice if the value has changed.
Application.getInstance().getBackend().forceSlice()
def _onGlobalContainerStackChanged(self):
## Ensure that the next stack is always the global stack.
self._stack.setNextStack(Application.getInstance().getGlobalContainerStack())