From 050e81053f27eac4d0e31675ec6e2aba4ceb6b24 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Wed, 27 Jul 2016 15:36:08 +0200 Subject: [PATCH] Double progress bar no longer occurs --- NetworkPrinterOutputDevice.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/NetworkPrinterOutputDevice.py b/NetworkPrinterOutputDevice.py index 11aa6992ef..109d3dd195 100644 --- a/NetworkPrinterOutputDevice.py +++ b/NetworkPrinterOutputDevice.py @@ -506,9 +506,10 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): elif "materials" in reply.url().toString(): # Remove cached post request items. del self._material_post_objects[id(reply)] - else: + elif "print_job" in reply.url().toString(): reply.uploadProgress.disconnect(self._onUploadProgress) self._progress_message.hide() + elif reply.operation() == QNetworkAccessManager.PutOperation: if status_code == 204: pass # Request was successful! @@ -519,6 +520,8 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): def _onUploadProgress(self, bytes_sent, bytes_total): if bytes_total > 0: - self._progress_message.setProgress(bytes_sent / bytes_total * 100) + new_progress = bytes_sent / bytes_total * 100 + if new_progress > self._progress_message.getProgress(): + self._progress_message.setProgress(bytes_sent / bytes_total * 100) else: self._progress_message.setProgress(0) \ No newline at end of file