mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-10 09:19:01 +08:00
Fix the enable & disable extruder for the settings menu
This fixes #6069
This commit is contained in:
parent
7883cf1807
commit
d1f6076eb2
@ -39,20 +39,41 @@ Menu
|
||||
MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Set as Active Extruder")
|
||||
onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index)
|
||||
// HACK: Instead of directly binding to the onTriggered handle, we have to use this workaround.
|
||||
// I've narrowed it down to it being an issue with the instantiator (removing that makes the
|
||||
// onTriggered work directly again).
|
||||
Component.onCompleted:
|
||||
{
|
||||
var index = model.index
|
||||
triggered.connect(function(){Cura.ExtruderManager.setActiveExtruderIndex(index)})
|
||||
}
|
||||
}
|
||||
|
||||
MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Enable Extruder")
|
||||
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true)
|
||||
// HACK: Instead of directly binding to the onTriggered handle, we have to use this workaround.
|
||||
// I've narrowed it down to it being an issue with the instantiator (removing that makes the
|
||||
// onTriggered work directly again).
|
||||
Component.onCompleted:
|
||||
{
|
||||
var index = model.index
|
||||
triggered.connect(function(){Cura.MachineManager.setExtruderEnabled(index, true)})
|
||||
}
|
||||
visible: !Cura.MachineManager.getExtruder(model.index).isEnabled
|
||||
}
|
||||
|
||||
MenuItem
|
||||
{
|
||||
text: catalog.i18nc("@action:inmenu", "Disable Extruder")
|
||||
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, false)
|
||||
// HACK: Instead of directly binding to the onTriggered handle, we have to use this workaround.
|
||||
// I've narrowed it down to it being an issue with the instantiator (removing that makes the
|
||||
// onTriggered work directly again).
|
||||
Component.onCompleted:
|
||||
{
|
||||
var index = model.index
|
||||
triggered.connect(function(){Cura.MachineManager.setExtruderEnabled(index, false)})
|
||||
}
|
||||
visible: Cura.MachineManager.getExtruder(model.index).isEnabled
|
||||
enabled: Cura.MachineManager.numberExtrudersEnabled > 1
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user