mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 06:57:28 -06:00
Use the material name instead of brand + type + color
CURA-8514 Fixes #10421
This commit is contained in:
parent
89c5a38afa
commit
2baada8a70
2 changed files with 11 additions and 7 deletions
|
@ -59,6 +59,8 @@ class ExtrudersModel(ListModel):
|
|||
defaultColors = ["#ffc924", "#86ec21", "#22eeee", "#245bff", "#9124ff", "#ff24c8"]
|
||||
"""List of colours to display if there is no material or the material has no known colour. """
|
||||
|
||||
MaterialNameRole = Qt.UserRole + 13
|
||||
|
||||
def __init__(self, parent = None):
|
||||
"""Initialises the extruders model, defining the roles and listening for changes in the data.
|
||||
|
||||
|
@ -79,6 +81,7 @@ class ExtrudersModel(ListModel):
|
|||
self.addRoleName(self.MaterialBrandRole, "material_brand")
|
||||
self.addRoleName(self.ColorNameRole, "color_name")
|
||||
self.addRoleName(self.MaterialTypeRole, "material_type")
|
||||
self.addRoleName(self.MaterialNameRole, "material_name")
|
||||
self._update_extruder_timer = QTimer()
|
||||
self._update_extruder_timer.setInterval(100)
|
||||
self._update_extruder_timer.setSingleShot(True)
|
||||
|
@ -199,8 +202,8 @@ class ExtrudersModel(ListModel):
|
|||
"material_brand": material_brand,
|
||||
"color_name": color_name,
|
||||
"material_type": extruder.material.getMetaDataEntry("material") if extruder.material else "",
|
||||
"material_name": extruder.material.getMetaDataEntry("name") if extruder.material else "",
|
||||
}
|
||||
|
||||
items.append(item)
|
||||
extruders_changed = True
|
||||
|
||||
|
@ -224,6 +227,7 @@ class ExtrudersModel(ListModel):
|
|||
"material_brand": "",
|
||||
"color_name": "",
|
||||
"material_type": "",
|
||||
"material_label": ""
|
||||
}
|
||||
items.append(item)
|
||||
if self._items != items:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue