Disable extruder enabled checkbox if it's the last one

You can't disable the last extruder.

Contributes to issue CURA-5876.
This commit is contained in:
Ghostkeeper 2018-11-30 16:43:48 +01:00
parent 82d4897ba4
commit d5d49fcec8
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -10,6 +10,12 @@ import UM 1.3 as UM
Item
{
UM.I18nCatalog
{
id: catalog
name: "cura"
}
width: parent.width
height: visible ? childrenRect.height : 0
@ -136,6 +142,7 @@ Item
OldControls.CheckBox
{
checked: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.isEnabled : false
enabled: !checked || Cura.MachineManager.numberExtrudersEnabled > 1 //Disable if it's the last enabled extruder.
height: UM.Theme.getSize("setting_control").height
style: UM.Theme.styles.checkbox
@ -148,6 +155,7 @@ Item
{
anchors.fill: parent
onClicked: Cura.MachineManager.setExtruderEnabled(Cura.ExtruderManager.activeExtruderIndex, !parent.checked)
enabled: parent.enabled
}
}
}