mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-30 22:31:21 -07:00
Show true extrudernames in Simple Mode support extruder selection combobox
CURA-333
This commit is contained in:
parent
eba2451cf2
commit
92905ada34
2 changed files with 14 additions and 7 deletions
|
|
@ -85,6 +85,8 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
||||||
if container.getMetaDataEntry("type") == "material":
|
if container.getMetaDataEntry("type") == "material":
|
||||||
self._updateExtruders()
|
self._updateExtruders()
|
||||||
|
|
||||||
|
modelChanged = pyqtSignal()
|
||||||
|
|
||||||
## Update the list of extruders.
|
## Update the list of extruders.
|
||||||
#
|
#
|
||||||
# This should be called whenever the list of extruders changes.
|
# This should be called whenever the list of extruders changes.
|
||||||
|
|
@ -127,3 +129,4 @@ class ExtrudersModel(UM.Qt.ListModel.ListModel):
|
||||||
self.appendItem(item)
|
self.appendItem(item)
|
||||||
|
|
||||||
self.sort(lambda item: item["index"])
|
self.sort(lambda item: item["index"])
|
||||||
|
self.modelChanged.emit()
|
||||||
|
|
|
||||||
|
|
@ -319,11 +319,13 @@ Item
|
||||||
id: extruderModel
|
id: extruderModel
|
||||||
Component.onCompleted: populateExtruderModel()
|
Component.onCompleted: populateExtruderModel()
|
||||||
}
|
}
|
||||||
Connections
|
|
||||||
|
//: Invisible list used to populate the extrudelModel
|
||||||
|
ListView
|
||||||
{
|
{
|
||||||
id: machineChange
|
id: extruders
|
||||||
target: Cura.MachineManager
|
model: Cura.ExtrudersModel { onModelChanged: populateExtruderModel() }
|
||||||
onGlobalContainerChanged: populateExtruderModel()
|
visible: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -331,11 +333,13 @@ Item
|
||||||
{
|
{
|
||||||
extruderModel.clear();
|
extruderModel.clear();
|
||||||
extruderModel.append({
|
extruderModel.append({
|
||||||
text: catalog.i18nc("@label", "Don't print support")
|
text: catalog.i18nc("@label", "Don't print support"),
|
||||||
|
color: ""
|
||||||
})
|
})
|
||||||
for(var extruder = 0; extruder < machineExtruderCount.properties.value ; extruder++) {
|
for(var extruderNr = 0; extruderNr < extruders.model.rowCount() ; extruderNr++) {
|
||||||
extruderModel.append({
|
extruderModel.append({
|
||||||
text: catalog.i18nc("@label", "Print using Extruder %1").arg(extruder + 1)
|
text: catalog.i18nc("@label", "Print using %1").arg(extruders.model.getItem(extruderNr).name),
|
||||||
|
color: extruders.model.getItem(extruderNr).colour
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue