Merge branch 'feature_intent_container_tree' of github.com:Ultimaker/Cura into feature_intent_container_tree

This commit is contained in:
Jaime van Kessel 2019-08-21 09:43:04 +02:00
commit 80dd8a0061
13 changed files with 26 additions and 25 deletions

View file

@ -270,7 +270,7 @@ class MaterialManager(QObject):
# Check if the material is active in any extruder train. In that case, the material shouldn't be removed!
# In the future we might enable this again, but right now, it's causing a ton of issues if we do (since it
# corrupts the configuration)
root_material_id = material_node.getMetaDataEntry("base_file")
root_material_id = material_node.container.getMetaDataEntry("base_file")
ids_to_remove = [metadata.get("id", "") for metadata in CuraContainerRegistry.getInstance().findInstanceContainersMetadata(base_file=root_material_id)]
for extruder_stack in CuraContainerRegistry.getInstance().findContainerStacks(type = "extruder_train"):
@ -280,7 +280,7 @@ class MaterialManager(QObject):
@pyqtSlot("QVariant", str)
def setMaterialName(self, material_node: "MaterialNode", name: str) -> None:
root_material_id = material_node.getMetaDataEntry("base_file")
root_material_id = material_node.container.getMetaDataEntry("base_file")
if root_material_id is None:
return
if CuraContainerRegistry.getInstance().isReadOnly(root_material_id):
@ -291,7 +291,7 @@ class MaterialManager(QObject):
@pyqtSlot("QVariant")
def removeMaterial(self, material_node: "MaterialNode") -> None:
root_material_id = material_node.getMetaDataEntry("base_file")
root_material_id = material_node.container.getMetaDataEntry("base_file")
if root_material_id is not None:
self.removeMaterialByRootId(root_material_id)
@ -355,7 +355,7 @@ class MaterialManager(QObject):
#
@pyqtSlot("QVariant", result = str)
def duplicateMaterial(self, material_node: MaterialNode, new_base_id: Optional[str] = None, new_metadata: Dict[str, Any] = None) -> Optional[str]:
root_material_id = cast(str, material_node.getMetaDataEntry("base_file", ""))
root_material_id = cast(str, material_node.container.getMetaDataEntry("base_file", ""))
return self.duplicateMaterialByRootId(root_material_id, new_base_id, new_metadata)
# Create a new material by cloning Generic PLA for the current material diameter and generate a new GUID.