Track progress from export job

This way we can show a progress bar.

Contributes to issue CURA-8609.
This commit is contained in:
Ghostkeeper 2021-10-12 10:24:07 +02:00
parent 052e33e66b
commit 025ef743ee
No known key found for this signature in database
GPG key ID: 68F39EA88EEED5FF
2 changed files with 27 additions and 6 deletions

View file

@ -37,12 +37,13 @@ class UploadMaterialsJob(Job):
self._scope = JsonDecoratorScope(UltimakerCloudScope(cura.CuraApplication.CuraApplication.getInstance())) # type: JsonDecoratorScope
uploadCompleted = Signal()
uploadProgressChanged = Signal()
def run(self):
archive_file = tempfile.NamedTemporaryFile("wb", delete = False)
archive_file.close()
self._material_sync.exportAll(QUrl.fromLocalFile(archive_file.name))
self._material_sync.exportAll(QUrl.fromLocalFile(archive_file.name), notify_progress = self.uploadProgressChanged)
http = HttpRequestManager.getInstance()
http.get(