mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-19 12:47:49 -06:00
Also remove the "current_settings" container when removing a machine
Contributes to CURA-1628
This commit is contained in:
parent
482bc21a9f
commit
163642f9ad
1 changed files with 6 additions and 0 deletions
|
@ -427,7 +427,13 @@ class MachineManagerModel(QObject):
|
||||||
def removeMachine(self, machine_id):
|
def removeMachine(self, machine_id):
|
||||||
# If the machine that is being removed is the currently active machine, set another machine as the active machine
|
# 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)
|
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)
|
UM.Settings.ContainerRegistry.getInstance().removeContainer(machine_id)
|
||||||
|
|
||||||
if activate_new_machine:
|
if activate_new_machine:
|
||||||
stacks = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(type = "machine")
|
stacks = UM.Settings.ContainerRegistry.getInstance().findContainerStacks(type = "machine")
|
||||||
if stacks:
|
if stacks:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue