NetworkPrinterMenu.qml 900 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. model: UM.ContainerStacksModel {
  9. filter: {"type": "machine", "um_network_key": "*", "hidden": "False"}
  10. }
  11. MenuItem {
  12. // TODO: Use printer_group icon when it's a cluster. Not use it for now since it doesn't look as expected
  13. // iconSource: UM.Theme.getIcon("printer_single")
  14. text: model.metadata["connect_group_name"]
  15. checkable: true;
  16. checked: Cura.MachineManager.activeMachineNetworkGroupName == model.metadata["connect_group_name"]
  17. exclusiveGroup: group;
  18. onTriggered: Cura.MachineManager.setActiveMachine(model.id);
  19. }
  20. onObjectAdded: menu.insertItem(index, object)
  21. onObjectRemoved: menu.removeItem(object)
  22. }