Просмотр исходного кода

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 лет назад
Родитель
Сommit
bcd44b8b6f
1 измененных файлов с 4 добавлено и 1 удалено
  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