CURA-4400 introduced value -1 for extruder number setting (not optional_extruder); this one takes the defaultExtruderPosition in MachineManager

This commit is contained in:
Jack Ha 2018-03-01 17:21:35 +01:00
parent 2538c689f1
commit 53ec846436
6 changed files with 56 additions and 31 deletions

View file

@ -72,6 +72,24 @@ SettingItem
value: control.currentText != "" ? control.model.getItem(control.currentIndex).color : ""
}
Binding
{
target: control
property: "currentIndex"
value:
{
if(propertyProvider.properties.value == -1)
{
// TODO: accidently the extruder position is also the index. fix it
return Cura.MachineManager.defaultExtruderPosition;
}
return propertyProvider.properties.value
}
// Sometimes when the value is already changed, the model is still being built.
// The when clause ensures that the current index is not updated when this happens.
when: control.model.items.length > 0
}
indicator: UM.RecolorImage
{
id: downArrow