From 273e93314581c5d78ce3291167ebaaf3b8800128 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 27 Oct 2021 14:13:49 +0200 Subject: [PATCH] Reset sync status when closing and re-opening sync window Otherwise when you want to sync again, it'll just say that you're done. Not what a user would expect, I reckon. Contributes to issue CURA-8609. --- cura/Machines/Models/MaterialManagementModel.py | 4 +++- cura/UltimakerCloud/CloudMaterialSync.py | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cura/Machines/Models/MaterialManagementModel.py b/cura/Machines/Models/MaterialManagementModel.py index 61d8e23acd..3595d3025a 100644 --- a/cura/Machines/Models/MaterialManagementModel.py +++ b/cura/Machines/Models/MaterialManagementModel.py @@ -272,6 +272,8 @@ class MaterialManagementModel(QObject): """ Opens the window to sync all materials. """ + self._material_sync.reset() + if self._material_sync.sync_all_dialog is None: qml_path = Resources.getPath(cura.CuraApplication.CuraApplication.ResourceTypes.QmlFiles, "Preferences", "Materials", "MaterialsSyncDialog.qml") self._material_sync.sync_all_dialog = cura.CuraApplication.CuraApplication.getInstance().createQmlComponent(qml_path, {}) @@ -279,4 +281,4 @@ class MaterialManagementModel(QObject): return self._material_sync.sync_all_dialog.setProperty("syncModel", self._material_sync) self._material_sync.sync_all_dialog.setProperty("pageIndex", 0) # Return to first page. - self._material_sync.sync_all_dialog.show() \ No newline at end of file + self._material_sync.sync_all_dialog.show() diff --git a/cura/UltimakerCloud/CloudMaterialSync.py b/cura/UltimakerCloud/CloudMaterialSync.py index 3a9402c36e..05f65bb822 100644 --- a/cura/UltimakerCloud/CloudMaterialSync.py +++ b/cura/UltimakerCloud/CloudMaterialSync.py @@ -191,4 +191,10 @@ class CloudMaterialSync(QObject): @pyqtProperty("QVariantMap", fset = setPrinterStatus, notify = printerStatusChanged) def printerStatus(self) -> Dict[str, str]: - return self._printer_status \ No newline at end of file + return self._printer_status + + def reset(self) -> None: + self.setPrinterStatus({}) + self.setExportProgress(0.0) + self._export_upload_status = "idle" + self.exportUploadStatusChanged.emit()