mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-01 08:14:22 +08:00

The extruder model gets updated way to much (for all material changes) but we only need the number and names of the extruders, since the other menu's do this by themselves
70 lines
2.3 KiB
QML
70 lines
2.3 KiB
QML
// Copyright (c) 2018 Ultimaker B.V.
|
|
// Cura is released under the terms of the LGPLv3 or higher.
|
|
|
|
import QtQuick 2.2
|
|
import QtQuick.Controls 1.1
|
|
|
|
import UM 1.2 as UM
|
|
import Cura 1.0 as Cura
|
|
|
|
Menu
|
|
{
|
|
id: base
|
|
title: catalog.i18nc("@title:menu menubar:toplevel", "&Settings")
|
|
|
|
PrinterMenu { title: catalog.i18nc("@title:menu menubar:settings", "&Printer") }
|
|
|
|
Instantiator
|
|
{
|
|
model: Cura.MachineManager.activeMachine.extruderList
|
|
|
|
Menu
|
|
{
|
|
title: modelData.name
|
|
|
|
NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: Cura.MachineManager.hasVariants; extruderIndex: index }
|
|
MaterialMenu { title: catalog.i18nc("@title:menu", "&Material"); visible: Cura.MachineManager.hasMaterials; extruderIndex: index }
|
|
|
|
MenuSeparator
|
|
{
|
|
visible: Cura.MachineManager.hasVariants || Cura.MachineManager.hasMaterials
|
|
}
|
|
|
|
MenuItem
|
|
{
|
|
text: catalog.i18nc("@action:inmenu", "Set as Active Extruder")
|
|
onTriggered: Cura.MachineManager.setExtruderIndex(model.index)
|
|
}
|
|
|
|
MenuItem
|
|
{
|
|
text: catalog.i18nc("@action:inmenu", "Enable Extruder")
|
|
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true)
|
|
visible: !Cura.MachineManager.getExtruder(model.index).isEnabled
|
|
}
|
|
|
|
MenuItem
|
|
{
|
|
text: catalog.i18nc("@action:inmenu", "Disable Extruder")
|
|
onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, false)
|
|
visible: Cura.MachineManager.getExtruder(model.index).isEnabled
|
|
enabled: Cura.MachineManager.numberExtrudersEnabled > 1
|
|
}
|
|
|
|
}
|
|
onObjectAdded: base.insertItem(index, object)
|
|
onObjectRemoved: base.removeItem(object)
|
|
}
|
|
|
|
// TODO Only show in dev mode. Remove check when feature ready
|
|
BuildplateMenu
|
|
{
|
|
title: catalog.i18nc("@title:menu", "&Build plate")
|
|
visible: CuraSDKVersion == "dev" && Cura.MachineManager.hasVariantBuildplates
|
|
}
|
|
ProfileMenu { title: catalog.i18nc("@title:settings", "&Profile") }
|
|
|
|
MenuSeparator { }
|
|
|
|
MenuItem { action: Cura.Actions.configureSettingVisibility }
|
|
} |