mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 05:19:08 +08:00
Register container tree to be built once all metadata is in
So if we ever change the order of initialisation this stays working. Contributes to issue CURA-6600.
This commit is contained in:
parent
d710a58233
commit
bd714f947a
@ -511,6 +511,8 @@ class CuraApplication(QtApplication):
|
|||||||
|
|
||||||
self.showSplashMessage(self._i18n_catalog.i18nc("@info:progress", "Loading machines..."))
|
self.showSplashMessage(self._i18n_catalog.i18nc("@info:progress", "Loading machines..."))
|
||||||
|
|
||||||
|
self._container_registry.allMetadataLoaded.connect(ContainerRegistry.getInstance)
|
||||||
|
|
||||||
with self._container_registry.lockFile():
|
with self._container_registry.lockFile():
|
||||||
self._container_registry.loadAllMetadata()
|
self._container_registry.loadAllMetadata()
|
||||||
|
|
||||||
@ -732,9 +734,6 @@ class CuraApplication(QtApplication):
|
|||||||
def run(self):
|
def run(self):
|
||||||
super().run()
|
super().run()
|
||||||
|
|
||||||
Logger.log("i", "Building container tree.")
|
|
||||||
ContainerTree.getInstance()
|
|
||||||
|
|
||||||
Logger.log("i", "Initializing machine manager")
|
Logger.log("i", "Initializing machine manager")
|
||||||
self._machine_manager = MachineManager(self, parent = self)
|
self._machine_manager = MachineManager(self, parent = self)
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Copyright (c) 2019 Ultimaker B.V.
|
# Copyright (c) 2019 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
|
from UM.Logger import Logger
|
||||||
from UM.Settings.ContainerRegistry import ContainerRegistry # To listen to containers being added.
|
from UM.Settings.ContainerRegistry import ContainerRegistry # To listen to containers being added.
|
||||||
from UM.Settings.DefinitionContainer import DefinitionContainer
|
from UM.Settings.DefinitionContainer import DefinitionContainer
|
||||||
from UM.Settings.Interfaces import ContainerInterface
|
from UM.Settings.Interfaces import ContainerInterface
|
||||||
@ -30,6 +31,7 @@ class ContainerTree:
|
|||||||
|
|
||||||
## Builds the initial container tree.
|
## Builds the initial container tree.
|
||||||
def _loadAll(self):
|
def _loadAll(self):
|
||||||
|
Logger.log("i", "Building container tree.")
|
||||||
all_stacks = ContainerRegistry.getInstance().findContainerStacks()
|
all_stacks = ContainerRegistry.getInstance().findContainerStacks()
|
||||||
for stack in all_stacks:
|
for stack in all_stacks:
|
||||||
definition_id = stack.definition.getId()
|
definition_id = stack.definition.getId()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user