Only set global stack in addMachine() if there was none

This commit is contained in:
Lipu Fei 2017-05-09 13:39:04 +02:00
parent f5342fcd20
commit 5706a540d9

View file

@ -343,7 +343,9 @@ class MachineManager(QObject):
def addMachine(self, name: str, definition_id: str) -> None:
new_stack = CuraStackBuilder.createMachine(name, definition_id)
if new_stack:
Application.getInstance().setGlobalContainerStack(new_stack)
# only set the global container stack if there was none
if self._global_container_stack is None:
Application.getInstance().setGlobalContainerStack(new_stack)
else:
Logger.log("w", "Failed creating a new machine!")