mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
Pass fields of ProgressUpdate explicitly
This commit is contained in:
parent
1ffcc5321c
commit
b002c45848
1 changed files with 2 additions and 4 deletions
|
@ -3,7 +3,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from dataclasses import asdict, dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
import aqt.forms
|
import aqt.forms
|
||||||
from anki._legacy import print_deprecation_warning
|
from anki._legacy import print_deprecation_warning
|
||||||
|
@ -190,7 +190,7 @@ class ProgressManager:
|
||||||
return
|
return
|
||||||
if dialog and dialog.wantCancel:
|
if dialog and dialog.wantCancel:
|
||||||
self.mw.backend.set_wants_abort()
|
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)
|
qconnect(self._backend_timer.timeout, on_progress)
|
||||||
self._backend_timer.start()
|
self._backend_timer.start()
|
||||||
|
@ -333,6 +333,4 @@ class ProgressDialog(QDialog):
|
||||||
class ProgressUpdate:
|
class ProgressUpdate:
|
||||||
label: str | None = None
|
label: str | None = None
|
||||||
value: int | None = None
|
value: int | None = None
|
||||||
process: bool = True
|
|
||||||
maybeShow: bool = True
|
|
||||||
max: int | None = None
|
max: int | None = None
|
||||||
|
|
Loading…
Reference in a new issue