SettingsMenu.qml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //Copyright (c) 2020 Ultimaker B.V.
  2. //Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.2
  4. import QtQuick.Controls 1.1
  5. import UM 1.2 as UM
  6. import Cura 1.0 as Cura
  7. Menu
  8. {
  9. id: base
  10. title: catalog.i18nc("@title:menu menubar:toplevel", "&Settings")
  11. PrinterMenu { title: catalog.i18nc("@title:menu menubar:settings", "&Printer") }
  12. property var activeMachine: Cura.MachineManager.activeMachine
  13. Instantiator
  14. {
  15. id: extruderInstantiator
  16. model: activeMachine == null ? null : activeMachine.extruderList
  17. Menu
  18. {
  19. title: modelData.name
  20. property var extruder: (base.activeMachine === null) ? null : activeMachine.extruderList[model.index]
  21. NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: Cura.MachineManager.activeMachine.hasVariants; extruderIndex: index }
  22. MaterialMenu { title: catalog.i18nc("@title:menu", "&Material"); visible: Cura.MachineManager.activeMachine.hasMaterials; extruderIndex: index }
  23. MenuSeparator
  24. {
  25. visible: Cura.MachineManager.activeMachine.hasVariants || Cura.MachineManager.activeMachine.hasMaterials
  26. }
  27. MenuItem
  28. {
  29. text: catalog.i18nc("@action:inmenu", "Set as Active Extruder")
  30. onTriggered: Cura.ExtruderManager.setActiveExtruderIndex(model.index)
  31. }
  32. MenuItem
  33. {
  34. text: catalog.i18nc("@action:inmenu", "Enable Extruder")
  35. onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true)
  36. visible: (extruder === null || extruder === undefined) ? false : !extruder.isEnabled
  37. }
  38. MenuItem
  39. {
  40. text: catalog.i18nc("@action:inmenu", "Disable Extruder")
  41. onTriggered: Cura.MachineManager.setExtruderEnabled(index, false)
  42. visible: (extruder === null || extruder === undefined) ? false : extruder.isEnabled
  43. enabled: Cura.MachineManager.numberExtrudersEnabled > 1
  44. }
  45. }
  46. onObjectAdded: base.insertItem(index, object)
  47. onObjectRemoved: base.removeItem(object)
  48. }
  49. MenuSeparator { }
  50. MenuItem { action: Cura.Actions.configureSettingVisibility }
  51. }