mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 10:29:05 +08:00
Activate another machine when we remove the currently active MachineManagerModel
CURA-1278
This commit is contained in:
parent
64a613f407
commit
6355631842
@ -266,6 +266,11 @@ class MachineManagerModel(QObject):
|
||||
|
||||
@pyqtSlot(str)
|
||||
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 self._global_container_stack and self._global_container_stack.getId() == machine_id:
|
||||
containers = UM.Settings.ContainerRegistry.getInstance().findContainerStacks()
|
||||
if containers:
|
||||
Application.getInstance().setGlobalContainerStack(containers[0])
|
||||
UM.Settings.ContainerRegistry.getInstance().removeContainer(machine_id)
|
||||
|
||||
@pyqtProperty(bool, notify = globalContainerChanged)
|
||||
|
Loading…
x
Reference in New Issue
Block a user