Show correct selected gcode flavor now there are more than 2 options

CURA-2304
This commit is contained in:
fieldOfView 2016-09-19 14:35:54 +02:00
parent 2e7dbea559
commit a62b0587ad

View File

@ -148,7 +148,15 @@ Cura.MachineAction
ComboBox
{
model: ["RepRap (Marlin/Sprinter)", "UltiGCode", "Repetier"]
currentIndex: machineGCodeFlavorProvider.properties.value != model[1] ? 0 : 1
currentIndex:
{
var index = model.indexOf(machineGCodeFlavorProvider.properties.value);
if(index == -1)
{
index = 0;
}
return index
}
onActivated:
{
machineGCodeFlavorProvider.setPropertyValue("value", model[index]);