Add a sidebar state for when a printer is not accepting commands

CURA-1851
This commit is contained in:
fieldOfView 2016-08-04 16:39:46 +02:00
parent 5f3c051ec6
commit cf06df8b07
3 changed files with 126 additions and 17 deletions

View file

@ -15,13 +15,14 @@ Rectangle
UM.I18nCatalog { id: catalog; name:"cura"}
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
property real progress: printerConnected ? Cura.MachineManager.printerOutputDevices[0].progress : 0
property int backendState: UM.Backend.state
property variant statusColor:
{
if(!printerConnected)
return UM.Theme.getColor("status_offline");
if(!printerConnected || !printerAcceptsCommands)
return UM.Theme.getColor("text");
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
{
@ -49,7 +50,9 @@ Rectangle
property string statusText:
{
if(!printerConnected)
return catalog.i18nc("@label:MonitorStatus", "Not connected to a printer")
return catalog.i18nc("@label:MonitorStatus", "Not connected to a printer");
if(!printerAcceptsCommands)
return catalog.i18nc("@label:MonitorStatus", "Printer does not accept commands");
var printerOutputDevice = Cura.MachineManager.printerOutputDevices[0]
switch(printerOutputDevice.jobState)
@ -253,7 +256,7 @@ Rectangle
return UM.Theme.getColor("action_button_text");
}
font: UM.Theme.getFont("action_button")
text: control.text;
text: control.text
}
}
label: Item { }