CURA-4606 CURA-5003 activate duplicated material and always switch to correct material after some material change

This commit is contained in:
Jack Ha 2018-02-26 16:33:25 +01:00
parent 2df9802ba5
commit c23827cfa1
2 changed files with 40 additions and 19 deletions

View file

@ -458,7 +458,7 @@ class ContainerManager(QObject):
## Create a duplicate of a material, which has the same GUID and base_file metadata
#
# \return \type{str} the id of the newly created container.
@pyqtSlot("QVariant")
@pyqtSlot("QVariant", result = str)
def duplicateMaterial(self, material_node, new_base_id = None, new_metadata = None):
root_material_id = material_node.metadata["base_file"]
@ -509,6 +509,7 @@ class ContainerManager(QObject):
for container_to_add in new_containers:
container_to_add.setDirty(True)
ContainerRegistry.getInstance().addContainer(container_to_add)
return new_base_id
## Create a new material by cloning Generic PLA for the current material diameter and setting the GUID to something unqiue
#