LocalPrinterMenu.qml 676 B

12345678910111213141516171819202122232425
  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.4
  5. import UM 1.2 as UM
  6. import Cura 1.0 as Cura
  7. Instantiator
  8. {
  9. model: Cura.GlobalStacksModel {}
  10. MenuItem
  11. {
  12. text: model.name
  13. checkable: true
  14. checked: Cura.MachineManager.activeMachine !== null ? Cura.MachineManager.activeMachine.id == model.id: false
  15. exclusiveGroup: group
  16. visible: !model.hasRemoteConnection
  17. onTriggered: Cura.MachineManager.setActiveMachine(model.id)
  18. }
  19. onObjectAdded: menu.insertItem(index, object)
  20. onObjectRemoved: menu.removeItem(object)
  21. }