Browse Source

Process events while extracting the downloaded backup

To prevent the UI from being frozen. This way, the user knows that something is happening in the background and Cura didn't just stop working.

CURA-8313
Konstantinos Karmas 3 years ago
parent
commit
bcd44b8b6f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      cura/Backups/Backup.py

+ 4 - 1
cura/Backups/Backup.py

@@ -194,7 +194,10 @@ class Backup:
         Resources.factoryReset()
         Logger.log("d", "Extracting backup to location: %s", target_path)
         try:
-            archive.extractall(target_path)
+            name_list = archive.namelist()
+            for archive_filename in name_list:
+                archive.extract(archive_filename, target_path)
+                CuraApplication.getInstance().processEvents()
         except (PermissionError, EnvironmentError):
             Logger.logException("e", "Unable to extract the backup due to permission or file system errors.")
             return False