Add monitor print button for cloud print

The button redirects the user to the cloud page

CURA-8018
This commit is contained in:
Jaime van Kessel 2021-07-08 17:01:03 +02:00
parent 920e220bdb
commit b4a8cb1b82
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -256,7 +256,16 @@ class CloudOutputDevice(UltimakerNetworkedPrinterOutputDevice):
"""
self._uploaded_print_job = self._pre_upload_print_job
self._progress.hide()
PrintJobUploadSuccessMessage().show()
message = PrintJobUploadSuccessMessage()
message.addAction("monitor print",
name=I18N_CATALOG.i18nc("@action:button", "Monitor Print"),
icon="",
description="Remove the plugin",
button_align=message.ActionButtonAlignment.ALIGN_RIGHT)
df_url = "https://digitalfactory.ultimaker.com/app/jobs/%s?utm_source=cura&utm_medium=software&utm_campaign=monitor-button" % self._cluster.cluster_id
message.pyQtActionTriggered.connect(lambda message, action: (QDesktopServices.openUrl(QUrl(df_url)), message.hide()))
message.show()
self.writeFinished.emit()
def _onPrintUploadSpecificError(self, reply: "QNetworkReply", _: "QNetworkReply.NetworkError"):