mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 17:49:01 +08: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
@ -134,9 +134,8 @@ Rectangle
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
text: catalog.i18nc("@label:", "Abort Print")
|
||||
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState("abort")
|
||||
|
||||
text: catalog.i18nc("@label:", "Abort Print");
|
||||
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState("abort");
|
||||
|
||||
style: ButtonStyle
|
||||
{
|
||||
@ -206,8 +205,36 @@ Rectangle
|
||||
enabled: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
|
||||
(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") : ""
|
||||
onClicked: Cura.MachineManager.printerOutputDevices[0].setJobState(Cura.MachineManager.printerOutputDevices[0].jobState == "paused" ? "print" : "pause")
|
||||
property bool userClicked: false
|
||||
|
||||
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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user