PrinterMenu.qml 886 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Copyright (c) 2016 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: menu;
  10. Instantiator
  11. {
  12. model: UM.ContainerStacksModel
  13. {
  14. filter: {"type": "machine"}
  15. }
  16. MenuItem
  17. {
  18. text: model.name;
  19. checkable: true;
  20. checked: Cura.MachineManager.activeMachineId == model.id
  21. exclusiveGroup: group;
  22. onTriggered: Cura.MachineManager.setActiveMachine(model.id);
  23. }
  24. onObjectAdded: menu.insertItem(index, object)
  25. onObjectRemoved: menu.removeItem(object)
  26. }
  27. ExclusiveGroup { id: group; }
  28. MenuSeparator { }
  29. MenuItem { action: Cura.Actions.addMachine; }
  30. MenuItem { action: Cura.Actions.configureMachines; }
  31. }