mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 23:33:14 +08:00
Disable controls when manual control is not available
This commit is contained in:
parent
9cd8869382
commit
6294900bc7
@ -683,10 +683,29 @@ Column
|
||||
property string label: catalog.i18nc("@label", "Printer control")
|
||||
}
|
||||
|
||||
Column
|
||||
{
|
||||
enabled:
|
||||
{
|
||||
if (connectedPrinter == null)
|
||||
{
|
||||
return false; //Can't control the printer if not connected.
|
||||
}
|
||||
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")
|
||||
{
|
||||
return false; //Printer is in a state where it can't react to manual control
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Row
|
||||
{
|
||||
width: base.width - 2 * UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height + 2 * UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height + UM.Theme.getSize("default_margin").width
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
@ -868,7 +887,7 @@ Column
|
||||
id: distancesRow
|
||||
|
||||
width: base.width - 2 * UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height + 2 * UM.Theme.getSize("default_margin").width
|
||||
height: childrenRect.height + UM.Theme.getSize("default_margin").width
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
@ -931,6 +950,7 @@ Column
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ListModel
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user