diff options
author | Ghostkeeper <rubend@tutanota.com> | 2021-10-08 16:15:57 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2021-10-08 16:15:57 +0300 |
commit | 599c59bd3a92ec9c7df6402110ec1cbfac6c746d (patch) | |
tree | afb203298c0f59995dfa4dd23e0ad14eede3b628 /cura/Machines | |
parent | a7f172d8360b0003c6551e1dc31fe854d5e873f4 (diff) |
Add a background job to upload material archives
It creates the archive now. It doesn't yet upload it.
Contributes to issue CURA-8609.
Diffstat (limited to 'cura/Machines')
-rw-r--r-- | cura/Machines/Models/MaterialManagementModel.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cura/Machines/Models/MaterialManagementModel.py b/cura/Machines/Models/MaterialManagementModel.py index d5191988fa..617fc5be9e 100644 --- a/cura/Machines/Models/MaterialManagementModel.py +++ b/cura/Machines/Models/MaterialManagementModel.py @@ -16,6 +16,7 @@ from UM.Signal import postponeSignals, CompressTechnique import cura.CuraApplication # Imported like this to prevent circular imports. from cura.Machines.ContainerTree import ContainerTree +from cura.PrinterOutput.UploadMaterialsJob import UploadMaterialsJob # To export materials to the output printer. from cura.Settings.CuraContainerRegistry import CuraContainerRegistry # To find the sets of materials belonging to each other, and currently loaded extruder stacks. if TYPE_CHECKING: @@ -385,3 +386,11 @@ class MaterialManagementModel(QObject): archive.writestr(filename, material.serialize()) except OSError as e: Logger.log("e", f"An error has occurred while writing the material \'{metadata['id']}\' in the file \'{filename}\': {e}.") + + @pyqtSlot() + def exportUpload(self) -> None: + """ + Export all materials and upload them to the user's account. + """ + job = UploadMaterialsJob() + job.start() |