From 163642f9ada9585f8582826b89c6f77c171b1a83 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 8 Jun 2016 14:05:16 +0200 Subject: [PATCH] Also remove the "current_settings" container when removing a machine Contributes to CURA-1628 --- cura/MachineManagerModel.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cura/MachineManagerModel.py b/cura/MachineManagerModel.py index e7034412f5..2738bfd764 100644 --- a/cura/MachineManagerModel.py +++ b/cura/MachineManagerModel.py @@ -427,7 +427,13 @@ class MachineManagerModel(QObject): def removeMachine(self, machine_id): # 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) + + current_settings_id = machine_id + "_current_settings" + containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = current_settings_id) + for container in containers: + UM.Settings.ContainerRegistry.getInstance().removeContainer(container.getId()) UM.Settings.ContainerRegistry.getInstance().removeContainer(machine_id) + if activate_new_machine: stacks = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(type = "machine") if stacks: