NozzleMenu.qml 926 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // Copyright (c) 2017 Ultimaker B.V.
  2. // Cura is released under the terms of the LGPLv3 or higher.
  3. import QtQuick 2.7
  4. import QtQuick.Controls 1.4
  5. import UM 1.2 as UM
  6. import Cura 1.0 as Cura
  7. Menu
  8. {
  9. id: menu
  10. title: "Nozzle"
  11. property int extruderIndex: 0
  12. Cura.NozzleModel
  13. {
  14. id: nozzleModel
  15. }
  16. Instantiator
  17. {
  18. model: nozzleModel
  19. MenuItem
  20. {
  21. text: model.hotend_name
  22. checkable: true
  23. checked: {
  24. return Cura.MachineManager.activeVariantNames[extruderIndex] == model.hotend_name
  25. }
  26. exclusiveGroup: group
  27. onTriggered: {
  28. Cura.MachineManager.setVariant(menu.extruderIndex, model.container_node);
  29. }
  30. }
  31. onObjectAdded: menu.insertItem(index, object);
  32. onObjectRemoved: menu.removeItem(object);
  33. }
  34. ExclusiveGroup { id: group }
  35. }