Fix: after extruders switch do not trigger slicing, provided a new signal

which is triggered after adding extruder and it subscribers for property changes
This commit is contained in:
Aleksei S 2018-01-11 13:32:05 +01:00
parent 78b42afbcb
commit 3f4a2c565c
2 changed files with 5 additions and 1 deletions

View file

@ -49,6 +49,9 @@ class ExtruderManager(QObject):
## Notify when the user switches the currently active extruder. ## Notify when the user switches the currently active extruder.
activeExtruderChanged = pyqtSignal() activeExtruderChanged = pyqtSignal()
## The signal notifies subscribers if extruders are added
extrudersAdded = pyqtSignal()
## Gets the unique identifier of the currently active extruder stack. ## Gets the unique identifier of the currently active extruder stack.
# #
# The currently active extruder stack is the stack that is currently being # The currently active extruder stack is the stack that is currently being
@ -406,6 +409,7 @@ class ExtruderManager(QObject):
if extruders_changed: if extruders_changed:
self.extrudersChanged.emit(global_stack_id) self.extrudersChanged.emit(global_stack_id)
self.extrudersAdded.emit()
self.setActiveExtruderIndex(0) self.setActiveExtruderIndex(0)
## Get all extruder values for a certain setting. ## Get all extruder values for a certain setting.

View file

@ -88,7 +88,7 @@ class CuraEngineBackend(QObject, Backend):
# #
self._global_container_stack = None self._global_container_stack = None
Application.getInstance().globalContainerStackChanged.connect(self._onGlobalStackChanged) Application.getInstance().globalContainerStackChanged.connect(self._onGlobalStackChanged)
Application.getInstance().getExtruderManager().activeExtruderChanged.connect(self._onGlobalStackChanged) Application.getInstance().getExtruderManager().extrudersAdded.connect(self._onGlobalStackChanged)
self._onGlobalStackChanged() self._onGlobalStackChanged()
Application.getInstance().stacksValidationFinished.connect(self._onStackErrorCheckFinished) Application.getInstance().stacksValidationFinished.connect(self._onStackErrorCheckFinished)