Implement lazy loading for machine nodes

Should be completely transparent. It'll fail the unit tests though because it now pretends that all printers have machine nodes.

Contributes to issue CURA-6793.
This commit is contained in:
Ghostkeeper 2019-10-09 10:53:58 +02:00
parent 0238f65e6a
commit 4ffda015db
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
2 changed files with 31 additions and 38 deletions

View file

@ -37,10 +37,6 @@ class CuraStackBuilder:
return None
machine_definition = definitions[0]
# The container tree listens to the containerAdded signal to add the definition and build the tree,
# but that signal is emitted with a delay which might not have passed yet.
# Therefore we must make sure that it's manually added here.
container_tree.addMachineNodeByDefinitionId(machine_definition.getId())
machine_node = container_tree.machines[machine_definition.getId()]
generated_name = registry.createUniqueName("machine", "", name, machine_definition.getName())