mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Disable controls when manual control is not available
This commit is contained in:
parent
9cd8869382
commit
6294900bc7
1 changed files with 245 additions and 225 deletions
|
|
@ -683,10 +683,29 @@ Column
|
||||||
property string label: catalog.i18nc("@label", "Printer control")
|
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
|
Row
|
||||||
{
|
{
|
||||||
width: base.width - 2 * UM.Theme.getSize("default_margin").width
|
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.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
|
|
@ -868,7 +887,7 @@ Column
|
||||||
id: distancesRow
|
id: distancesRow
|
||||||
|
|
||||||
width: base.width - 2 * UM.Theme.getSize("default_margin").width
|
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.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
|
|
@ -931,6 +950,7 @@ Column
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ListModel
|
ListModel
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue