diff --git a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py index b7c0818c72..36369feabb 100644 --- a/cura/PrinterOutput/NetworkedPrinterOutputDevice.py +++ b/cura/PrinterOutput/NetworkedPrinterOutputDevice.py @@ -204,7 +204,7 @@ class NetworkedPrinterOutputDevice(PrinterOutputDevice): self._validateManager() request = self._createEmptyRequest(target) self._last_request_time = time() - reply = self._manager.delete(request) + reply = self._manager.deleteResource(request) self._registerOnFinishedCallback(reply, on_finished) def get(self, target: str, on_finished: Optional[Callable[[QNetworkReply], None]]) -> None: diff --git a/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py b/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py index fffab6caec..cbb5f25ee8 100644 --- a/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py +++ b/plugins/UM3NetworkPrinting/ClusterUM3OutputDevice.py @@ -374,6 +374,12 @@ class ClusterUM3OutputDevice(NetworkedPrinterOutputDevice): data = "{\"to_position\": 0}" self.put("print_jobs/{uuid}/move_to_position".format(uuid = print_job_uuid), data, on_finished=None) + @pyqtSlot(str) + def deleteJobFromQueue(self, print_job_uuid: str) -> None: + # This function is part of the output device (and not of the printjob output model) as this type of operation + # is a modification of the cluster queue and not of the actual job. + self.delete("print_jobs/{uuid}".format(uuid = print_job_uuid), on_finished=None) + def _printJobStateChanged(self) -> None: username = self._getUserName() diff --git a/plugins/UM3NetworkPrinting/PrintJobInfoBlock.qml b/plugins/UM3NetworkPrinting/PrintJobInfoBlock.qml index 72b46339e5..0c30255b08 100644 --- a/plugins/UM3NetworkPrinting/PrintJobInfoBlock.qml +++ b/plugins/UM3NetworkPrinting/PrintJobInfoBlock.qml @@ -135,7 +135,7 @@ Item //y: configurationSelector.height - UM.Theme.getSize("default_lining").height //x: configurationSelector.width - width width: 200 - height: childrenRect.height + height: contentItem.height + 2 * padding visible: false padding: UM.Theme.getSize("default_lining").width transformOrigin: Popup.Top @@ -145,17 +145,27 @@ Item height: childrenRect.height Button { + id: sendToTopButton text: "Send to top" onClicked: OutputDevice.sendJobToTop(printJob.key) width: parent.width enabled: OutputDevice.printJobs[0].key != printJob.key } + Button + { + id: deleteButton + text: "Delete" + onClicked: OutputDevice.deleteJobFromQueue(printJob.key) + width: parent.width + anchors.top: sendToTopButton.bottom + } } background: Rectangle { color: UM.Theme.getColor("setting_control") border.color: UM.Theme.getColor("setting_control_border") + height: popup.height } exit: Transition