mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-22 22:23:57 -06:00
Move setMaterialName() into MaterialManager
This commit is contained in:
parent
f7377e6321
commit
c6128ef5ba
4 changed files with 22 additions and 13 deletions
|
@ -160,17 +160,6 @@ class ContainerManager(QObject):
|
|||
|
||||
return container.getProperty(setting_key, property_name)
|
||||
|
||||
## Set the name of the specified material.
|
||||
@pyqtSlot("QVariant", str)
|
||||
def setMaterialName(self, material_node, new_name):
|
||||
root_material_id = material_node.metadata["base_file"]
|
||||
if self._container_registry.isReadOnly(root_material_id):
|
||||
Logger.log("w", "Cannot set name of read-only container %s.", root_material_id)
|
||||
return
|
||||
|
||||
material_group = self._material_manager.getMaterialGroup(root_material_id)
|
||||
material_group.root_material_node.getContainer().setName(new_name)
|
||||
|
||||
@pyqtSlot(str, result = str)
|
||||
def makeUniqueName(self, original_name):
|
||||
return self._container_registry.uniqueName(original_name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue