NetworkPrinterMenu.qml 860 B

1234567891011121314151617181920212223242526272829303132
  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. property string connectGroupName:
  13. {
  14. if("group_name" in model.metadata)
  15. {
  16. return model.metadata["group_name"]
  17. }
  18. return ""
  19. }
  20. text: connectGroupName
  21. checkable: true
  22. visible: model.hasRemoteConnection
  23. checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName
  24. exclusiveGroup: group
  25. onTriggered: Cura.MachineManager.setActiveMachine(model.id)
  26. }
  27. onObjectAdded: menu.insertItem(index, object)
  28. onObjectRemoved: menu.removeItem(object)
  29. }