Fix getting name and colour from extruder

There used to be an extruder object from which we could ask these properties. But now we have a container stack in its place, so we need to get the properties in a slightly different way.

Contributes to issues CURA-1278 and CURA-340.
This commit is contained in:
Ghostkeeper 2016-06-08 10:56:51 +02:00
parent af484b03d8
commit 4aa495f9ef
No known key found for this signature in database
GPG Key ID: 701948C5954A7385

View File

@ -53,8 +53,8 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
return #There is no machine to get the extruders of.
for index, extruder in manager.getMachineExtruders(global_container_stack.getBottom()):
item = { #Construct an item with only the relevant information.
"name": extruder.name,
"colour": extruder.material.getMetaDataEntry("color_code", default = "#FFFF00"),
"name": extruder.getName(),
"colour": extruder.findContainer(type = "material").getMetaDataEntry("color_code", default = "#FFFF00"),
"index": index
}
self.appendItem(item)