mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 06:33:55 -06:00
Move duplicateMaterial into MaterialManagementModel
To move away from the deprecated MaterialManager class. Contributes to issue CURA-6600.
This commit is contained in:
parent
924d4cc13b
commit
1874a6453d
3 changed files with 69 additions and 5 deletions
|
@ -298,7 +298,6 @@ class MaterialManager(QObject):
|
|||
|
||||
# Create a new ID & container to hold the data.
|
||||
new_containers = []
|
||||
container_registry = CuraContainerRegistry.getInstance()
|
||||
if new_base_id is None:
|
||||
new_base_id = container_registry.uniqueName(base_container.getId())
|
||||
new_base_container = copy.deepcopy(base_container)
|
||||
|
@ -334,9 +333,10 @@ class MaterialManager(QObject):
|
|||
|
||||
# if the duplicated material was favorite then the new material should also be added to favorite.
|
||||
if root_material_id in self.getFavorites():
|
||||
self.addFavorite(new_base_id)
|
||||
cura.CuraApplication.CuraApplication.getInstance().getMaterialManagementModel().addFavorite(new_base_id)
|
||||
|
||||
return new_base_id
|
||||
|
||||
#
|
||||
# Creates a duplicate of a material, which has the same GUID and base_file metadata.
|
||||
# Returns the root material ID of the duplicated material if successful.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue