SettingsMenu.qml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Copyright (c) 2018 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. Instantiator
  13. {
  14. model: Cura.MachineManager.activeMachine.extruderList
  15. Menu
  16. {
  17. title: modelData.name
  18. NozzleMenu { title: Cura.MachineManager.activeDefinitionVariantsName; visible: Cura.MachineManager.hasVariants; extruderIndex: index }
  19. MaterialMenu { title: catalog.i18nc("@title:menu", "&Material"); visible: Cura.MachineManager.hasMaterials; extruderIndex: index }
  20. MenuSeparator
  21. {
  22. visible: Cura.MachineManager.hasVariants || Cura.MachineManager.hasMaterials
  23. }
  24. MenuItem
  25. {
  26. text: catalog.i18nc("@action:inmenu", "Set as Active Extruder")
  27. onTriggered: Cura.MachineManager.setExtruderIndex(model.index)
  28. }
  29. MenuItem
  30. {
  31. text: catalog.i18nc("@action:inmenu", "Enable Extruder")
  32. onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, true)
  33. visible: !Cura.MachineManager.getExtruder(model.index).isEnabled
  34. }
  35. MenuItem
  36. {
  37. text: catalog.i18nc("@action:inmenu", "Disable Extruder")
  38. onTriggered: Cura.MachineManager.setExtruderEnabled(model.index, false)
  39. visible: Cura.MachineManager.getExtruder(model.index).isEnabled
  40. enabled: Cura.MachineManager.numberExtrudersEnabled > 1
  41. }
  42. }
  43. onObjectAdded: base.insertItem(index, object)
  44. onObjectRemoved: base.removeItem(object)
  45. }
  46. // TODO Only show in dev mode. Remove check when feature ready
  47. BuildplateMenu
  48. {
  49. title: catalog.i18nc("@title:menu", "&Build plate")
  50. visible: CuraSDKVersion == "dev" && Cura.MachineManager.hasVariantBuildplates
  51. }
  52. ProfileMenu { title: catalog.i18nc("@title:settings", "&Profile") }
  53. MenuSeparator { }
  54. MenuItem { action: Cura.Actions.configureSettingVisibility }
  55. }