mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
Double progress bar no longer occurs
This commit is contained in:
parent
fd36f09b29
commit
050e81053f
1 changed files with 5 additions and 2 deletions
|
@ -506,9 +506,10 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||||
elif "materials" in reply.url().toString():
|
elif "materials" in reply.url().toString():
|
||||||
# Remove cached post request items.
|
# Remove cached post request items.
|
||||||
del self._material_post_objects[id(reply)]
|
del self._material_post_objects[id(reply)]
|
||||||
else:
|
elif "print_job" in reply.url().toString():
|
||||||
reply.uploadProgress.disconnect(self._onUploadProgress)
|
reply.uploadProgress.disconnect(self._onUploadProgress)
|
||||||
self._progress_message.hide()
|
self._progress_message.hide()
|
||||||
|
|
||||||
elif reply.operation() == QNetworkAccessManager.PutOperation:
|
elif reply.operation() == QNetworkAccessManager.PutOperation:
|
||||||
if status_code == 204:
|
if status_code == 204:
|
||||||
pass # Request was successful!
|
pass # Request was successful!
|
||||||
|
@ -519,6 +520,8 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||||
|
|
||||||
def _onUploadProgress(self, bytes_sent, bytes_total):
|
def _onUploadProgress(self, bytes_sent, bytes_total):
|
||||||
if bytes_total > 0:
|
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:
|
else:
|
||||||
self._progress_message.setProgress(0)
|
self._progress_message.setProgress(0)
|
Loading…
Add table
Add a link
Reference in a new issue