mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Fix duplicating a favourite material
The duplicate must also be favourite. Contributes to issue CURA-6600.
This commit is contained in:
parent
1874a6453d
commit
957894b614
1 changed files with 6 additions and 4 deletions
|
@ -86,7 +86,8 @@ class MaterialManagementModel(QObject):
|
|||
root_material = root_materials[0]
|
||||
|
||||
# Ensure that all settings are saved.
|
||||
cura.CuraApplication.CuraApplication.getInstance().saveSettings()
|
||||
application = cura.CuraApplication.CuraApplication.getInstance()
|
||||
application.saveSettings()
|
||||
|
||||
# Create a new ID and container to hold the data.
|
||||
if new_base_id is None:
|
||||
|
@ -122,8 +123,9 @@ class MaterialManagementModel(QObject):
|
|||
container_registry.addContainer(container_to_add)
|
||||
|
||||
# If the duplicated material was favorite then the new material should also be added to the favorites.
|
||||
# TODO: Move favourites to here.
|
||||
#if material_node.base_file in self.getFavorites():
|
||||
# self.addFavorite(new_base_id)
|
||||
favorites_set = set(application.getPreferences().getValue("cura/favorite_materials").split(";"))
|
||||
if material_node.base_file in favorites_set:
|
||||
favorites_set.add(new_base_id)
|
||||
application.getPreferences().setValue("cura/favorite_materials", ";".join(favorites_set))
|
||||
|
||||
return new_base_id
|
Loading…
Add table
Add a link
Reference in a new issue