Remove container stack and user profile for extruders when removing a printer

CURA-1896
This commit is contained in:
fieldOfView 2016-07-12 10:53:50 +02:00
parent a7cfe1b5af
commit ae4beeb0ed
2 changed files with 17 additions and 1 deletions

View file

@ -635,6 +635,11 @@ class MachineManager(QObject):
# If the machine that is being removed is the currently active machine, set another machine as the active machine.
activate_new_machine = (self._global_container_stack and self._global_container_stack.getId() == machine_id)
stacks = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(id = machine_id)
if not stacks:
return
ExtruderManager.getInstance().removeMachineExtruders(stacks[0].getBottom().getId())
current_settings_id = machine_id + "_current_settings"
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = current_settings_id)
for container in containers: