Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2021-10-12 10:43:21 +0300
committerGhostkeeper <rubend@tutanota.com>2021-10-12 10:43:21 +0300
commit4661b02e4c42a0d47a3078bfe79aaac4b19bb1b9 (patch)
treee91815248ed0fac1763162cfe73cd8c099cd96c3 /cura/PrinterOutput
parentc3d392c5cf77eea2086d1776b764e7678dd52d56 (diff)
Move code and status related to uploading materials to separate class
There's quite a lot of status to track, errors and progress. It's better kept separate. Contributes to issue CURA-8609.
Diffstat (limited to 'cura/PrinterOutput')
-rw-r--r--cura/PrinterOutput/UploadMaterialsJob.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/cura/PrinterOutput/UploadMaterialsJob.py b/cura/PrinterOutput/UploadMaterialsJob.py
index 45ac653337..2e7a2c1575 100644
--- a/cura/PrinterOutput/UploadMaterialsJob.py
+++ b/cura/PrinterOutput/UploadMaterialsJob.py
@@ -18,6 +18,7 @@ from UM.TaskManagement.HttpRequestScope import JsonDecoratorScope
from typing import Optional, TYPE_CHECKING
if TYPE_CHECKING:
from PyQt5.QtNetwork import QNetworkReply
+ from cura.UltimakerCloud.CloudMaterialSync import CloudMaterialSync
class UploadMaterialsJob(Job):
"""
@@ -30,8 +31,9 @@ class UploadMaterialsJob(Job):
SUCCCESS = 0
FAILED = 1
- def __init__(self):
+ def __init__(self, material_sync: "CloudMaterialSync"):
super().__init__()
+ self._material_sync = material_sync
self._scope = JsonDecoratorScope(UltimakerCloudScope(cura.CuraApplication.CuraApplication.getInstance())) # type: JsonDecoratorScope
uploadCompleted = Signal()
@@ -40,7 +42,7 @@ class UploadMaterialsJob(Job):
archive_file = tempfile.NamedTemporaryFile("wb", delete = False)
archive_file.close()
- cura.CuraApplication.CuraApplication.getInstance().getMaterialManagementModel().exportAll(QUrl.fromLocalFile(archive_file.name))
+ self._material_sync.exportAll(QUrl.fromLocalFile(archive_file.name))
http = HttpRequestManager.getInstance()
http.get(