BuildplateMenu.qml 826 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) 2018 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: "Build plate"
  11. property var buildPlateModel: CuraApplication.getBuildPlateModel()
  12. Instantiator
  13. {
  14. model: menu.buildPlateModel
  15. MenuItem {
  16. text: model.name
  17. checkable: true
  18. checked: model.name == Cura.MachineManager.globalVariantName
  19. exclusiveGroup: group
  20. onTriggered: {
  21. Cura.MachineManager.setGlobalVariant(model.container_node);
  22. }
  23. }
  24. onObjectAdded: menu.insertItem(index, object)
  25. onObjectRemoved: menu.removeItem(object)
  26. }
  27. ExclusiveGroup { id: group }
  28. }