mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Added delete button to cluster queue
CL-894
This commit is contained in:
parent
db1d90ed9b
commit
eb7d42a7f8
3 changed files with 18 additions and 2 deletions
|
@ -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:
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue