mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Fix disabling preheat button when printer is not idle
This commit is contained in:
parent
13206e1fdc
commit
f135b1675c
2 changed files with 12 additions and 6 deletions
|
|
@ -130,10 +130,13 @@ Item
|
||||||
{
|
{
|
||||||
return false; //Not allowed to do anything.
|
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)
|
||||||
|
{
|
||||||
|
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 false; //Printer is in a state where it can't react to pre-heating.
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
|
|
@ -144,7 +147,7 @@ Item
|
||||||
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
||||||
width: UM.Theme.getSize("monitor_preheat_temperature_control").width
|
width: UM.Theme.getSize("monitor_preheat_temperature_control").width
|
||||||
height: UM.Theme.getSize("monitor_preheat_temperature_control").height
|
height: UM.Theme.getSize("monitor_preheat_temperature_control").height
|
||||||
visible: extruderModel != null ? extruderModel.canPreHeatHotends && !extruderModel.isPreheating : true
|
visible: extruderModel != null ? enabled && extruderModel.canPreHeatHotends && !extruderModel.isPreheating : true
|
||||||
Rectangle //Highlight of input field.
|
Rectangle //Highlight of input field.
|
||||||
{
|
{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
||||||
|
|
@ -114,10 +114,13 @@ Item
|
||||||
{
|
{
|
||||||
return false; //Not allowed to do anything.
|
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)
|
||||||
|
{
|
||||||
|
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 false; //Printer is in a state where it can't react to pre-heating.
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
|
|
@ -128,7 +131,7 @@ Item
|
||||||
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
anchors.bottomMargin: UM.Theme.getSize("default_margin").height
|
||||||
width: UM.Theme.getSize("monitor_preheat_temperature_control").width
|
width: UM.Theme.getSize("monitor_preheat_temperature_control").width
|
||||||
height: UM.Theme.getSize("monitor_preheat_temperature_control").height
|
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.
|
Rectangle //Highlight of input field.
|
||||||
{
|
{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue