Also trigger a reslice when the containerstack's containers change

Contributes to CURA-1278
This commit is contained in:
Arjen Hiemstra 2016-05-30 14:02:51 +02:00
parent 8039184c18
commit 93873a2ce8

View file

@ -307,7 +307,7 @@ class CuraEngineBackend(Backend):
## Called when anything has changed to the stuff that needs to be sliced. ## Called when anything has changed to the stuff that needs to be sliced.
# #
# This indicates that we should probably re-slice soon. # This indicates that we should probably re-slice soon.
def _onChanged(self): def _onChanged(self, *args, **kwargs):
self._change_timer.start() self._change_timer.start()
## Called when the back-end connects to the front-end. ## Called when the back-end connects to the front-end.
@ -362,9 +362,11 @@ class CuraEngineBackend(Backend):
def _onGlobalStackChanged(self): def _onGlobalStackChanged(self):
if self._global_container_stack: if self._global_container_stack:
self._global_container_stack.propertyChanged.disconnect(self._onSettingChanged) self._global_container_stack.propertyChanged.disconnect(self._onSettingChanged)
self._global_container_stack.containersChanged.disconnect(self._onChanged)
self._global_container_stack = Application.getInstance().getGlobalContainerStack() self._global_container_stack = Application.getInstance().getGlobalContainerStack()
if self._global_container_stack: if self._global_container_stack:
self._global_container_stack.propertyChanged.connect(self._onSettingChanged) #Note: Only starts slicing when the value changed. self._global_container_stack.propertyChanged.connect(self._onSettingChanged) #Note: Only starts slicing when the value changed.
self._global_container_stack.containersChanged.connect(self._onChanged)
self._onChanged() self._onChanged()