Fix disabling preheat button when printer is not idle

This commit is contained in:
fieldOfView 2018-01-18 10:20:37 +01:00
parent 13206e1fdc
commit f135b1675c
2 changed files with 12 additions and 6 deletions

View file

@ -114,9 +114,12 @@ Item
{
return false; //Not allowed to do anything.
}
if (connectedPrinter.jobState == "printing" || connectedPrinter.jobState == "pre_print" || connectedPrinter.jobState == "resuming" || connectedPrinter.jobState == "pausing" || connectedPrinter.jobState == "paused" || connectedPrinter.jobState == "error" || connectedPrinter.jobState == "offline")
if (connectedPrinter.activePrinter && connectedPrinter.activePrinter.activePrintJob)
{
return false; //Printer is in a state where it can't react to pre-heating.
if((["printing", "pre_print", "resuming", "pausing", "paused", "error", "offline"]).indexOf(connectedPrinter.activePrinter.activePrintJob.state) != -1)
{
return false; //Printer is in a state where it can't react to pre-heating.
}
}
return true;
}
@ -128,7 +131,7 @@ Item
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
width: UM.Theme.getSize("monitor_preheat_temperature_control").width
height: UM.Theme.getSize("monitor_preheat_temperature_control").height
visible: printerModel != null ? printerModel.canPreHeatBed && !printerModel.isPreheating : true
visible: printerModel != null ? enabled && printerModel.canPreHeatBed && !printerModel.isPreheating : true
Rectangle //Highlight of input field.
{
anchors.fill: parent