mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-16 11:17:49 -06:00
Fix import issues
CURA-6600
This commit is contained in:
parent
fc3461d865
commit
719e69692c
2 changed files with 10 additions and 7 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
from UM.Logger import Logger
|
||||||
from UM.Util import parseBool
|
from UM.Util import parseBool
|
||||||
from UM.Settings.ContainerRegistry import ContainerRegistry # To find all the variants for this machine.
|
from UM.Settings.ContainerRegistry import ContainerRegistry # To find all the variants for this machine.
|
||||||
from UM.Settings.Interfaces import ContainerInterface
|
from UM.Settings.Interfaces import ContainerInterface
|
||||||
|
@ -22,8 +23,11 @@ class MachineNode(ContainerNode):
|
||||||
self.variants = {} # type: Dict[str, VariantNode] # Mapping variant names to their nodes.
|
self.variants = {} # type: Dict[str, VariantNode] # Mapping variant names to their nodes.
|
||||||
self.global_qualities = {} # type: Dict[str, QualityNode] # Mapping quality types to the global quality for those types.
|
self.global_qualities = {} # type: Dict[str, QualityNode] # Mapping quality types to the global quality for those types.
|
||||||
container_registry = ContainerRegistry.getInstance()
|
container_registry = ContainerRegistry.getInstance()
|
||||||
|
try:
|
||||||
my_metadata = container_registry.findContainersMetadata(id = container_id)[0]
|
my_metadata = container_registry.findContainersMetadata(id = container_id)[0]
|
||||||
|
except IndexError:
|
||||||
|
Logger.log("Unable to find metadata for container %s", container_id)
|
||||||
|
my_metadata = {}
|
||||||
# Some of the metadata is cached upon construction here.
|
# Some of the metadata is cached upon construction here.
|
||||||
# ONLY DO THAT FOR METADATA THAT DOESN'T CHANGE DURING RUNTIME!
|
# ONLY DO THAT FOR METADATA THAT DOESN'T CHANGE DURING RUNTIME!
|
||||||
# Otherwise you need to keep it up-to-date during runtime.
|
# Otherwise you need to keep it up-to-date during runtime.
|
||||||
|
|
|
@ -28,7 +28,6 @@ if TYPE_CHECKING:
|
||||||
from cura.Machines.ContainerNode import ContainerNode
|
from cura.Machines.ContainerNode import ContainerNode
|
||||||
from cura.Machines.MaterialNode import MaterialNode
|
from cura.Machines.MaterialNode import MaterialNode
|
||||||
from cura.Machines.QualityChangesGroup import QualityChangesGroup
|
from cura.Machines.QualityChangesGroup import QualityChangesGroup
|
||||||
from cura.Settings.MachineManager import MachineManager
|
|
||||||
from cura.Machines.MaterialManager import MaterialManager
|
from cura.Machines.MaterialManager import MaterialManager
|
||||||
from cura.Machines.QualityManager import QualityManager
|
from cura.Machines.QualityManager import QualityManager
|
||||||
|
|
||||||
|
@ -269,11 +268,11 @@ class ContainerManager(QObject):
|
||||||
# \return \type{bool} True if successful, False if not.
|
# \return \type{bool} True if successful, False if not.
|
||||||
@pyqtSlot(result = bool)
|
@pyqtSlot(result = bool)
|
||||||
def updateQualityChanges(self) -> bool:
|
def updateQualityChanges(self) -> bool:
|
||||||
global_stack = MachineManager.getInstance().activeMachine
|
global_stack = cura.CuraApplication.CuraApplication.getInstance().getMachineManager().activeMachine
|
||||||
if not global_stack:
|
if not global_stack:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
MachineManager.getInstance().blurSettings.emit()
|
cura.CuraApplication.CuraApplication.getInstance().getMachineManager().blurSettings.emit()
|
||||||
|
|
||||||
current_quality_changes_name = global_stack.qualityChanges.getName()
|
current_quality_changes_name = global_stack.qualityChanges.getName()
|
||||||
current_quality_type = global_stack.quality.getMetaDataEntry("quality_type")
|
current_quality_type = global_stack.quality.getMetaDataEntry("quality_type")
|
||||||
|
@ -296,14 +295,14 @@ class ContainerManager(QObject):
|
||||||
|
|
||||||
self._performMerge(quality_changes, stack.getTop())
|
self._performMerge(quality_changes, stack.getTop())
|
||||||
|
|
||||||
MachineManager.getInstance().activeQualityChangesGroupChanged.emit()
|
cura.CuraApplication.CuraApplication.getInstance().getMachineManager().activeQualityChangesGroupChanged.emit()
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
## Clear the top-most (user) containers of the active stacks.
|
## Clear the top-most (user) containers of the active stacks.
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def clearUserContainers(self) -> None:
|
def clearUserContainers(self) -> None:
|
||||||
machine_manager = MachineManager.getInstance()
|
machine_manager = cura.CuraApplication.CuraApplication.getInstance().getMachineManager()
|
||||||
machine_manager.blurSettings.emit()
|
machine_manager.blurSettings.emit()
|
||||||
|
|
||||||
send_emits_containers = []
|
send_emits_containers = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue