Display "move to top" button in monitor page

CURA-9940
This commit is contained in:
c.lamboo 2022-12-09 14:05:03 +01:00
parent 3f699a35f4
commit ca290a32fb

View file

@ -23,7 +23,7 @@ Item
//So compute here the visibility of the menu items, so that we can use it for the visibility of the button. //So compute here the visibility of the menu items, so that we can use it for the visibility of the button.
property bool sendToTopVisible: property bool sendToTopVisible:
{ {
if (printJob && printJob.state in ("queued", "error") && !isAssigned(printJob)) { if (printJob && (printJob.state == "queued" || printJob.state == "error")) {
if (OutputDevice && OutputDevice.queuedPrintJobs[0] && OutputDevice.canWriteOthersPrintJobs) { if (OutputDevice && OutputDevice.queuedPrintJobs[0] && OutputDevice.canWriteOthersPrintJobs) {
return OutputDevice.queuedPrintJobs[0].key != printJob.key; return OutputDevice.queuedPrintJobs[0].key != printJob.key;
} }
@ -246,10 +246,4 @@ Item
function close() { function close() {
popUp.close() popUp.close()
} }
function isAssigned(job) {
if (!job) {
return false;
}
return job.assignedPrinter ? true : false;
}
} }