PrinterTypeMenu.qml 911 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.3 as UM
  6. import Cura 1.0 as Cura
  7. Menu
  8. {
  9. id: menu
  10. title: "Printer type"
  11. property var outputDevice: Cura.MachineManager.printerOutputDevices[0]
  12. Instantiator
  13. {
  14. id: printerTypeInstantiator
  15. model: outputDevice != null ? outputDevice.connectedPrintersTypeCount : []
  16. MenuItem {
  17. text: modelData.machine_type
  18. checkable: true
  19. checked: Cura.MachineManager.activeMachineDefinitionName == modelData.machine_type
  20. exclusiveGroup: group
  21. // onTriggered:
  22. // {
  23. // TODO
  24. // }
  25. }
  26. onObjectAdded: menu.insertItem(index, object)
  27. onObjectRemoved: menu.removeItem(object)
  28. }
  29. ExclusiveGroup { id: group }
  30. }