mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 03:06:00 +08:00
Format extrudername to include material name
CURA-333
This commit is contained in:
parent
f083d41353
commit
68ee4f0ea1
@ -107,7 +107,10 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
|||||||
self.appendItem(item)
|
self.appendItem(item)
|
||||||
|
|
||||||
for extruder in manager.getMachineExtruders(global_container_stack.getBottom().getId()):
|
for extruder in manager.getMachineExtruders(global_container_stack.getBottom().getId()):
|
||||||
|
extruder_name = extruder.getName()
|
||||||
material = extruder.findContainer({ "type": "material" })
|
material = extruder.findContainer({ "type": "material" })
|
||||||
|
if material:
|
||||||
|
extruder_name = "%s (%s)" % (material.getName(), extruder_name)
|
||||||
position = extruder.getBottom().getMetaDataEntry("position", default = "0") #Position in the definition.
|
position = extruder.getBottom().getMetaDataEntry("position", default = "0") #Position in the definition.
|
||||||
try:
|
try:
|
||||||
position = int(position)
|
position = int(position)
|
||||||
@ -117,7 +120,7 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
|||||||
colour = material.getMetaDataEntry("color_code", default = default_colour) if material else default_colour
|
colour = material.getMetaDataEntry("color_code", default = default_colour) if material else default_colour
|
||||||
item = { #Construct an item with only the relevant information.
|
item = { #Construct an item with only the relevant information.
|
||||||
"id": extruder.getId(),
|
"id": extruder.getId(),
|
||||||
"name": extruder.getName(),
|
"name": extruder_name,
|
||||||
"colour": colour,
|
"colour": colour,
|
||||||
"index": position
|
"index": position
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user