mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
Add sanity check for GlobalStack CURA-5045
This commit is contained in:
parent
5a194bb6d1
commit
00d8427e42
4 changed files with 24 additions and 5 deletions
|
@ -6,6 +6,7 @@ import time
|
|||
#Type hinting.
|
||||
from typing import List, Dict, TYPE_CHECKING, Optional
|
||||
|
||||
from UM.ConfigurationErrorMessage import ConfigurationErrorMessage
|
||||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||
from UM.Signal import Signal
|
||||
|
||||
|
@ -165,8 +166,6 @@ class MachineManager(QObject):
|
|||
if active_machine_id != "" and ContainerRegistry.getInstance().findContainerStacksMetadata(id = active_machine_id):
|
||||
# An active machine was saved, so restore it.
|
||||
self.setActiveMachine(active_machine_id)
|
||||
# Make sure _active_container_stack is properly initiated
|
||||
ExtruderManager.getInstance().setActiveExtruderIndex(0)
|
||||
|
||||
def _onOutputDevicesChanged(self) -> None:
|
||||
self._printer_output_devices = []
|
||||
|
@ -357,6 +356,10 @@ class MachineManager(QObject):
|
|||
return
|
||||
|
||||
global_stack = containers[0]
|
||||
if not global_stack.isValid():
|
||||
# Mark global stack as invalid
|
||||
ConfigurationErrorMessage.getInstance().addFaultyContainers(global_stack.getId())
|
||||
return # We're done here
|
||||
ExtruderManager.getInstance().setActiveExtruderIndex(0) # Switch to first extruder
|
||||
self._global_container_stack = global_stack
|
||||
Application.getInstance().setGlobalContainerStack(global_stack)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue