From a766effce8917337624b3d030400797fa73c2adb Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 11 Dec 2018 12:43:43 +0100 Subject: [PATCH 1/4] Fix typing for optional callback for on_progress --- cura/NetworkClient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura/NetworkClient.py b/cura/NetworkClient.py index 5294813fb7..6abf4f3d47 100644 --- a/cura/NetworkClient.py +++ b/cura/NetworkClient.py @@ -203,7 +203,7 @@ class NetworkClient: ## Does a POST request with form data to the given URL. def postForm(self, url: str, header_data: str, body_data: bytes, on_finished: Optional[Callable[[QNetworkReply], None]], - on_progress: Callable = None) -> None: + on_progress: Optional[Callable[[int, int], None]] = None) -> None: post_part = QHttpPart() post_part.setHeader(QNetworkRequest.ContentDispositionHeader, header_data) post_part.setBody(body_data) @@ -212,7 +212,7 @@ class NetworkClient: ## Does a POST request with form parts to the given URL. def postFormWithParts(self, target: str, parts: List[QHttpPart], on_finished: Optional[Callable[[QNetworkReply], None]], - on_progress: Callable = None) -> Optional[QNetworkReply]: + on_progress: Optional[Callable[[int, int], None]] = None) -> Optional[QNetworkReply]: self._validateManager() request = self._createEmptyRequest(target, content_type = None) From e52339a4248a5cf3a1aa423528e3c654defeb2e2 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 11 Dec 2018 12:44:37 +0100 Subject: [PATCH 2/4] Fix typing for output_device param in cloud output controller --- plugins/UM3NetworkPrinting/src/Cloud/CloudOutputController.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputController.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputController.py index d31d2bf486..b2a8d8649b 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputController.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputController.py @@ -1,10 +1,11 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +from UM.OutputDevice.OutputDevice import OutputDevice from cura.PrinterOutput.PrinterOutputController import PrinterOutputController class CloudOutputController(PrinterOutputController): - def __init__(self, output_device): + def __init__(self, output_device: OutputDevice): super().__init__(output_device) # The cloud connection only supports fetching the printer and queue status and adding a job to the queue. From 7b7c687db7792634a178a2a6b001d6566b40f4c6 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 11 Dec 2018 12:46:05 +0100 Subject: [PATCH 3/4] Remove dismissable = False from messages as it's the default --- plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py index e68eb47839..5e0d34e902 100644 --- a/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py +++ b/plugins/UM3NetworkPrinting/src/Cloud/CloudOutputDevice.py @@ -320,8 +320,7 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice): Message( text = message, title = T.ERROR, - lifetime = 10, - dismissable = True + lifetime = 10 ).show() self._sending_job = False # the upload has finished so we're not sending a job anymore self.writeError.emit() @@ -334,8 +333,7 @@ class CloudOutputDevice(NetworkedPrinterOutputDevice): Message( text = T.UPLOAD_SUCCESS_TEXT, title = T.UPLOAD_SUCCESS_TITLE, - lifetime = 5, - dismissable = True, + lifetime = 5 ).show() self._sending_job = False # the upload has finished so we're not sending a job anymore self.writeFinished.emit() From e4939cf0051d4f679e8156df26b46e5a22f8b26d Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 11 Dec 2018 12:55:49 +0100 Subject: [PATCH 4/4] Remove outdated cloud icon, will be done in another PR --- .../cura-light/icons/printer_cloud_connected.svg | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 resources/themes/cura-light/icons/printer_cloud_connected.svg diff --git a/resources/themes/cura-light/icons/printer_cloud_connected.svg b/resources/themes/cura-light/icons/printer_cloud_connected.svg deleted file mode 100644 index 59ca67e93e..0000000000 --- a/resources/themes/cura-light/icons/printer_cloud_connected.svg +++ /dev/null @@ -1,13 +0,0 @@ - - - - noun_Cloud_377836 - Created with Sketch. - - - - - - - - \ No newline at end of file