Add printer type selector if connected to cluster

If there are 2 or more printer types in your connected cluster, you can switch the printer type here.

Contributes to issue CURA-5876.
This commit is contained in:
Ghostkeeper 2018-12-07 15:21:53 +01:00
parent 78df27369f
commit ffcac04f9e
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276

View file

@ -36,10 +36,57 @@ Item
}
}
//Printer type selector.
Item
{
id: printerTypeSelectorRow
visible:
{
return Cura.MachineManager.printerOutputDevices.length >= 1 //If connected...
&& Cura.MachineManager.printerOutputDevices[0].connectedPrintersTypeCount != null //...and we have configuration information...
&& Cura.MachineManager.printerOutputDevices[0].connectedPrintersTypeCount.length > 1; //...and there is more than one type of printer in the configuration list.
}
height: visible ? childrenRect.height : 0
anchors
{
left: parent.left
leftMargin: UM.Theme.getSize("default_margin").width
right: parent.right
rightMargin: UM.Theme.getSize("default_margin").width
top: header.bottom
topMargin: visible ? UM.Theme.getSize("default_margin").height : 0
}
Label
{
text: catalog.i18nc("@label", "Printer")
width: Math.round(parent.width * 0.3) - UM.Theme.getSize("default_margin").width
height: contentHeight
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("text")
anchors.verticalCenter: printerTypeSelector.verticalCenter
anchors.left: parent.left
}
OldControls.ToolButton
{
id: printerTypeSelector
text: Cura.MachineManager.activeMachineDefinitionName
tooltip: Cura.MachineManager.activeMachineDefinitionName
height: UM.Theme.getSize("setting_control").height
width: Math.round(parent.width * 0.7) + UM.Theme.getSize("default_margin").width
anchors.right: parent.right
style: UM.Theme.styles.print_setup_header_button
menu: Cura.PrinterTypeMenu { }
}
}
UM.TabRow
{
id: tabBar
anchors.top: header.bottom
anchors.top: printerTypeSelectorRow.bottom
anchors.topMargin: UM.Theme.getSize("default_margin").height
visible: extrudersModel.count > 1