Disable printers that are not host of a group

CURA-6449

 - Group printers into hosts and non-hosts and of unknown type.
 - Show available/connectable printers first in the list.
 - Show sections for connectable and non-connectable printers.
This commit is contained in:
Lipu Fei 2019-04-11 11:32:02 +02:00
parent 7d644c0d1a
commit 588dd6cd78
3 changed files with 36 additions and 4 deletions

View file

@ -71,6 +71,10 @@ Item
anchors.fill: parent
model: CuraApplication.getDiscoveredPrintersModel().discoveredPrinters
section.property: "modelData.sectionName"
section.criteria: ViewSection.FullString
section.delegate: sectionHeading
Component.onCompleted:
{
// Select the first one that's not "unknown" by default.
@ -84,6 +88,23 @@ Item
}
}
Component
{
id: sectionHeading
Label
{
anchors.left: parent.left
anchors.leftMargin: UM.Theme.getSize("default_margin").width
height: UM.Theme.getSize("setting_control").height
text: section
font: UM.Theme.getFont("default")
color: UM.Theme.getColor("small_button_text")
verticalAlignment: Text.AlignVCenter
renderType: Text.NativeRendering
}
}
delegate: MachineSelectorButton
{
text: modelData.device.name
@ -93,7 +114,7 @@ Item
anchors.rightMargin: UM.Theme.getSize("default_margin").width
outputDevice: modelData.device
enabled: !modelData.isUnknownMachineType
enabled: !modelData.isUnknownMachineType && modelData.isHostOfGroup
printerTypeLabelAutoFit: true