mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Added user feedback after pressing Pause / Resume in network printer.
The button displays Pausing... or Resuming... until a new status update. CURA-2060
This commit is contained in:
parent
ca8ded6c35
commit
1bd0d65e0a
1 changed files with 32 additions and 5 deletions
|
@ -134,9 +134,8 @@ Rectangle
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
text: catalog.i18nc("@label:", "Abort Print")
|
text: catalog.i18nc("@label:", "Abort Print");
|
||||||
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState("abort")
|
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState("abort");
|
||||||
|
|
||||||
|
|
||||||
style: ButtonStyle
|
style: ButtonStyle
|
||||||
{
|
{
|
||||||
|
@ -206,8 +205,36 @@ Rectangle
|
||||||
enabled: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
|
enabled: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
|
||||||
(Cura.MachineManager.printerOutputDevices[0].jobState == "paused" || Cura.MachineManager.printerOutputDevices[0].jobState == "printing")
|
(Cura.MachineManager.printerOutputDevices[0].jobState == "paused" || Cura.MachineManager.printerOutputDevices[0].jobState == "printing")
|
||||||
|
|
||||||
text: printerConnected ? Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? catalog.i18nc("@label:", "Resume") : catalog.i18nc("@label:", "Pause") : ""
|
property bool userClicked: false
|
||||||
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState(Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? "print" : "pause")
|
|
||||||
|
text: {
|
||||||
|
var result = "";
|
||||||
|
if (!printerConnected) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Cura.MachineManager.printerOutputDevices[0].jobState == "paused")
|
||||||
|
{
|
||||||
|
if (userClicked) {
|
||||||
|
result = catalog.i18nc("@label:", "Resuming...");
|
||||||
|
} else {
|
||||||
|
result = catalog.i18nc("@label:", "Resume");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (userClicked) {
|
||||||
|
result = catalog.i18nc("@label:", "Pausing...");
|
||||||
|
} else {
|
||||||
|
result = catalog.i18nc("@label:", "Pause");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
userClicked = false;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
onClicked: {
|
||||||
|
var newJobState = Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? "print" : "pause";
|
||||||
|
Cura.MachineManager.printerOutputDevices[0].setJobState(newJobState);
|
||||||
|
userClicked = true;
|
||||||
|
}
|
||||||
|
|
||||||
style: ButtonStyle
|
style: ButtonStyle
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue