Fixed status icon in monitor tab

CL-541
This commit is contained in:
Jaime van Kessel 2017-11-24 10:55:24 +01:00
parent 9d7cd72691
commit 57406100ef
2 changed files with 14 additions and 5 deletions

View File

@ -100,15 +100,15 @@ Column
visible: connectedPrinter != null ? connectedPrinter.canControlManually : false visible: connectedPrinter != null ? connectedPrinter.canControlManually : false
enabled: enabled:
{ {
if (connectedPrinter == null) if (connectedPrinter == null || activePrintJob == null)
{ {
return false; //Can't control the printer if not connected. return false; //Can't control the printer if not connected or if there is no print job.
} }
if (!connectedPrinter.acceptsCommands) if (!connectedPrinter.acceptsCommands)
{ {
return false; //Not allowed to do anything. return false; //Not allowed to do anything.
} }
if (connectedPrinter.jobState == "printing" || connectedPrinter.jobState == "resuming" || connectedPrinter.jobState == "pausing" || connectedPrinter.jobState == "error" || connectedPrinter.jobState == "offline") if (activePrintJob.state == "printing" || activePrintJob.state == "resuming" || activePrintJob.state == "pausing" || activePrintJob.state == "error" || activePrintJob.state == "offline")
{ {
return false; //Printer is in a state where it can't react to manual control return false; //Printer is in a state where it can't react to manual control
} }

View File

@ -124,13 +124,22 @@ Rectangle
{ {
return UM.Theme.getIcon("tab_status_unknown"); return UM.Theme.getIcon("tab_status_unknown");
} }
if (Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") if (Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance")
{ {
return UM.Theme.getIcon("tab_status_busy"); return UM.Theme.getIcon("tab_status_busy");
} }
switch (Cura.MachineManager.printerOutputDevices[0].jobState) if(Cura.MachineManager.printerOutputDevices[0].activePrinter == null)
{
return UM.Theme.getIcon("tab_status_connected")
}
if(Cura.MachineManager.printerOutputDevices[0].activePrinter.activePrintJob == null)
{
return UM.Theme.getIcon("tab_status_connected")
}
switch (Cura.MachineManager.printerOutputDevices[0].activePrinter.activePrintJob.state)
{ {
case "printing": case "printing":
case "pre_print": case "pre_print":