From 57406100ef5355d6093514e931a472a89716dc5f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 24 Nov 2017 10:55:24 +0100 Subject: [PATCH] Fixed status icon in monitor tab CL-541 --- resources/qml/PrintMonitor.qml | 6 +++--- resources/qml/Topbar.qml | 13 +++++++++++-- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/resources/qml/PrintMonitor.qml b/resources/qml/PrintMonitor.qml index 172adc21c1..5b6f96dfc1 100644 --- a/resources/qml/PrintMonitor.qml +++ b/resources/qml/PrintMonitor.qml @@ -100,15 +100,15 @@ Column visible: connectedPrinter != null ? connectedPrinter.canControlManually : false 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) { 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 } diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index 6085c6fe7e..63d0981830 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -124,13 +124,22 @@ Rectangle { return UM.Theme.getIcon("tab_status_unknown"); } - if (Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") { 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 "pre_print":