Handle idle, unavailable, and unreachable states

Contributes to CL-1153
This commit is contained in:
Ian Paschal 2018-12-03 14:41:45 +01:00
parent c9ed044205
commit cced42a55b

View file

@ -169,6 +169,30 @@ Item
height: childrenRect.height
spacing: 18 * screenScaleFactor // TODO: Theme!
Label
{
id: printerStatus
anchors
{
verticalCenter: parent.verticalCenter
}
color: "#414054" // TODO: Theme!
font: UM.Theme.getFont("large") // 16pt, bold
text: {
if (printer && printer.state == "disabled"){
return catalog.i18nc("@label:status", "Unavailable")
}
if (printer && printer.state == "unreachable"){
return catalog.i18nc("@label:status", "Unavailable")
}
if (printer && !printer.activePrintJob)
{
return catalog.i18nc("@label:status", "Idle")
}
return ""
}
}
Item
{
anchors