From b002c45848f777bc428753f5a3ea5fca26d2c3e8 Mon Sep 17 00:00:00 2001 From: RumovZ Date: Sat, 30 Apr 2022 08:54:17 +0200 Subject: [PATCH] Pass fields of ProgressUpdate explicitly --- qt/aqt/progress.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qt/aqt/progress.py b/qt/aqt/progress.py index 7f2c471b8..70f6db58a 100644 --- a/qt/aqt/progress.py +++ b/qt/aqt/progress.py @@ -3,7 +3,7 @@ from __future__ import annotations import time -from dataclasses import asdict, dataclass +from dataclasses import dataclass import aqt.forms from anki._legacy import print_deprecation_warning @@ -190,7 +190,7 @@ class ProgressManager: return if dialog and dialog.wantCancel: self.mw.backend.set_wants_abort() - self.update(**asdict(update)) + self.update(label=update.label, value=update.value, max=update.max) qconnect(self._backend_timer.timeout, on_progress) self._backend_timer.start() @@ -333,6 +333,4 @@ class ProgressDialog(QDialog): class ProgressUpdate: label: str | None = None value: int | None = None - process: bool = True - maybeShow: bool = True max: int | None = None