Cura/resources/qml/Menus/NetworkPrinterMenu.qml
fieldOfView c81689d233 Prevent a recurring qml warning
Note that the connect_group metadata is also queried for non-connected printers; the model is not filtered, but non-connected printers are set to be invisible.
2019-01-11 17:40:36 +01:00

33 lines
876 B
QML

// Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2
import QtQuick.Controls 1.4
import UM 1.2 as UM
import Cura 1.0 as Cura
Instantiator
{
model: Cura.GlobalStacksModel {}
MenuItem
{
property string connectGroupName:
{
if("connect_group_name" in model.metadata)
{
return model.metadata["connect_group_name"]
}
return ""
}
text: connectGroupName
checkable: true
visible: model.hasRemoteConnection
checked: Cura.MachineManager.activeMachineNetworkGroupName == connectGroupName
exclusiveGroup: group
onTriggered: Cura.MachineManager.setActiveMachine(model.id)
}
onObjectAdded: menu.insertItem(index, object)
onObjectRemoved: menu.removeItem(object)
}