mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
Enable force override print job in local network, fix override button not enabled on older firmwares
This commit is contained in:
parent
de3f82610a
commit
9e6e9a4beb
3 changed files with 25 additions and 1 deletions
|
@ -494,6 +494,25 @@ Item
|
|||
implicitWidth: 96 * screenScaleFactor // TODO: Theme!
|
||||
visible: printer && printer.activePrintJob && printer.activePrintJob.configurationChanges.length > 0 && !printerStatus.visible
|
||||
onClicked: base.enabled ? overrideConfirmationDialog.open() : {}
|
||||
enabled: OutputDevice.supportsPrintJobActions
|
||||
}
|
||||
|
||||
// For cloud printing, add this mouse area over the disabled details button to indicate that it's not available
|
||||
MouseArea
|
||||
{
|
||||
id: detailsButtonDisabledButtonArea
|
||||
anchors.fill: detailsButton
|
||||
hoverEnabled: detailsButton.visible && !detailsButton.enabled
|
||||
onEntered: overrideButtonDisabledInfo.open()
|
||||
onExited: overrideButtonDisabledInfo.close()
|
||||
enabled: !detailsButton.enabled
|
||||
}
|
||||
|
||||
MonitorInfoBlurb
|
||||
{
|
||||
id: overrideButtonDisabledInfo
|
||||
text: catalog.i18nc("@info", "Please update your printer's firmware to manage the queue remotely.")
|
||||
target: detailsButton
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -63,6 +63,11 @@ class ClusterApiClient:
|
|||
url = "{}/print_jobs/{}/action/move".format(self.CLUSTER_API_PREFIX, print_job_uuid)
|
||||
self._manager.post(self._createEmptyRequest(url), json.dumps({"to_position": 0, "list": "queued"}).encode())
|
||||
|
||||
## Override print job configuration and force it to be printed.
|
||||
def forcePrintJob(self, print_job_uuid: str) -> None:
|
||||
url = "{}/print_jobs/{}".format(self.CLUSTER_API_PREFIX, print_job_uuid)
|
||||
self._manager.put(self._createEmptyRequest(url), json.dumps({"force": True}).encode())
|
||||
|
||||
## Delete a print job from the queue.
|
||||
def deletePrintJob(self, print_job_uuid: str) -> None:
|
||||
url = "{}/print_jobs/{}".format(self.CLUSTER_API_PREFIX, print_job_uuid)
|
||||
|
|
|
@ -86,7 +86,7 @@ class LocalClusterOutputDevice(UltimakerNetworkedPrinterOutputDevice):
|
|||
|
||||
@pyqtSlot(str, name="forceSendJob")
|
||||
def forceSendJob(self, print_job_uuid: str) -> None:
|
||||
pass # TODO
|
||||
self._getApiClient().forcePrintJob(print_job_uuid)
|
||||
|
||||
## Set the remote print job state.
|
||||
# \param print_job_uuid: The UUID of the print job to set the state for.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue