mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 00:39:01 +08:00
Update print monitor button labels and enabled. CURA-2060
This commit is contained in:
parent
2d723cbb57
commit
223b8f28bb
@ -226,33 +226,42 @@ Rectangle
|
|||||||
anchors.right: abortButton.left
|
anchors.right: abortButton.left
|
||||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||||
|
|
||||||
visible: printerConnected
|
|
||||||
enabled: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
|
|
||||||
(["paused", "printing"].indexOf(Cura.MachineManager.printerOutputDevices[0].jobState) >= 0)
|
|
||||||
|
|
||||||
property bool userClicked: false
|
property bool userClicked: false
|
||||||
|
property string lastJobState: ""
|
||||||
|
|
||||||
|
visible: printerConnected
|
||||||
|
enabled: (!userClicked) && printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands &&
|
||||||
|
(["paused", "printing"].indexOf(Cura.MachineManager.printerOutputDevices[0].jobState) >= 0)
|
||||||
|
|
||||||
text: {
|
text: {
|
||||||
var result = "";
|
var result = "";
|
||||||
|
var jobState = Cura.MachineManager.printerOutputDevices[0].jobState;
|
||||||
if (!printerConnected) {
|
if (!printerConnected) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Cura.MachineManager.printerOutputDevices[0].jobState == "paused")
|
if (lastJobState !== jobState) {
|
||||||
|
// the userClicked message must disappear when an "automated" jobState comes by
|
||||||
|
userClicked = false;
|
||||||
|
lastJobState = jobState;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jobState == "paused")
|
||||||
{
|
{
|
||||||
if (userClicked) {
|
if (userClicked) {
|
||||||
result = catalog.i18nc("@label:", "Resuming...");
|
// User feedback for pretending we're already in "printing" mode.
|
||||||
|
result = catalog.i18nc("@label:", "Pause");
|
||||||
} else {
|
} else {
|
||||||
result = catalog.i18nc("@label:", "Resume");
|
result = catalog.i18nc("@label:", "Resume");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (userClicked) {
|
if (userClicked) {
|
||||||
result = catalog.i18nc("@label:", "Pausing...");
|
// User feedback for pretending we're already in "pause" mode.
|
||||||
|
result = catalog.i18nc("@label:", "Resume");
|
||||||
} else {
|
} else {
|
||||||
result = catalog.i18nc("@label:", "Pause");
|
result = catalog.i18nc("@label:", "Pause");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
userClicked = false;
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user