Don't show the context menu for printed jobs (only active ones and queued ones)

Contributes to CL-1118
This commit is contained in:
Ian Paschal 2018-10-30 13:44:24 +01:00
parent 1680548a39
commit 0273cd2a0e

View file

@ -33,6 +33,7 @@ Item {
hoverEnabled: true; hoverEnabled: true;
onClicked: parent.switchPopupState(); onClicked: parent.switchPopupState();
text: "\u22EE"; //Unicode; Three stacked points. text: "\u22EE"; //Unicode; Three stacked points.
visible: printJob.state == "queued" || running ? true : false;
width: 35 * screenScaleFactor; // TODO: Theme! width: 35 * screenScaleFactor; // TODO: Theme!
} }
@ -101,7 +102,7 @@ Item {
PrintJobContextMenuItem { PrintJobContextMenuItem {
enabled: { enabled: {
if (printJob && !running) { if (printJob && printJob.state == "queued") {
if (OutputDevice && OutputDevice.queuedPrintJobs[0]) { if (OutputDevice && OutputDevice.queuedPrintJobs[0]) {
return OutputDevice.queuedPrintJobs[0].key != printJob.key; return OutputDevice.queuedPrintJobs[0].key != printJob.key;
} }
@ -116,7 +117,7 @@ Item {
} }
PrintJobContextMenuItem { PrintJobContextMenuItem {
enabled: printJob && !running; enabled: printJob && printJob.state == "queued";
onClicked: { onClicked: {
deleteConfirmationDialog.visible = true; deleteConfirmationDialog.visible = true;
popup.close(); popup.close();