mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Improve the Favorites, Base, and Brand materials models (WIP)
Contribuetes to CURA-5378
This commit is contained in:
parent
2410c21839
commit
68bccd8bf7
3 changed files with 36 additions and 14 deletions
|
@ -17,7 +17,7 @@ class FavoriteMaterialsModel(BaseMaterialsModel):
|
|||
|
||||
self._machine_manager.activeStackChanged.connect(self._update) #Update when switching machines.
|
||||
self._material_manager.materialsUpdated.connect(self._update) #Update when the list of materials changes.
|
||||
|
||||
self._material_manager.favoritesUpdated.connect(self._update) # Update when favorites are changed
|
||||
self._update()
|
||||
|
||||
def _update(self):
|
||||
|
@ -38,7 +38,9 @@ class FavoriteMaterialsModel(BaseMaterialsModel):
|
|||
self.setItems([])
|
||||
return
|
||||
|
||||
favorite_ids = self._preferences.getValue("cura/favorite_materials")
|
||||
favorite_ids = self._material_manager.getFavorites()
|
||||
|
||||
print("favorite_ids:", favorite_ids)
|
||||
|
||||
item_list = []
|
||||
for root_material_id, container_node in available_material_dict.items():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue