mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 12:15:59 +08:00
Also remove the "current_settings" container when removing a machine
Contributes to CURA-1628
This commit is contained in:
parent
482bc21a9f
commit
163642f9ad
@ -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…
x
Reference in New Issue
Block a user