Apply fix for single extrusion machines when a new global stack is added

CURA-4713

Now the machines are not all loaded in the beginning, so the old way of
adding extruder stacks for old single-extrusion machines don't work.
With this fix, it now happens whenever a global stack is added to the
registry.
This commit is contained in:
Lipu Fei 2017-12-15 14:45:06 +01:00
parent 57651e837f
commit f26872ec1f
2 changed files with 23 additions and 3 deletions

View file

@ -369,7 +369,9 @@ class MachineManager(QObject):
self.blurSettings.emit() # Ensure no-one has focus.
self._cancelDelayedActiveContainerStackChanges()
containers = ContainerRegistry.getInstance().findContainerStacks(id = stack_id)
container_registry = ContainerRegistry.getInstance()
containers = container_registry.findContainerStacks(id = stack_id)
if containers:
Application.getInstance().setGlobalContainerStack(containers[0])