From 63556318425f595129aaee1aa8b6e98f1c9d1e39 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Fri, 27 May 2016 11:53:53 +0200 Subject: [PATCH] Activate another machine when we remove the currently active MachineManagerModel CURA-1278 --- cura/MachineManagerModel.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cura/MachineManagerModel.py b/cura/MachineManagerModel.py index 11cb55d2b4..7b42483fca 100644 --- a/cura/MachineManagerModel.py +++ b/cura/MachineManagerModel.py @@ -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)