mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 04:37:22 -05:00
* qt: normalize large progress totals to kilobytes to avoid QProgressBar overflow (#4341); docs: update CONTRIBUTORS * update * revert: keep ProgressManager generic; no autoscaling in progress.py * revert: keep ProgressManager generic; do scaling only in full sync * Simplify sync progress update by scaling to KB, fix CONTRIBUTORS
This commit is contained in:
parent
0986af4f81
commit
b2bb85b1a2
2 changed files with 13 additions and 2 deletions
|
|
@ -247,6 +247,8 @@ Hanna Nilsén <hanni614@student.liu.se>
|
|||
Elias Johansson Lara <elias.johanssonlara@gmail.com>
|
||||
Toby Penner <tobypenner01@gmail.com>
|
||||
Danilo Spillebeen <spillebeendanilo@gmail.com>
|
||||
Matbe766 <matildabergstrom01@gmail.com>
|
||||
|
||||
|
||||
********************
|
||||
|
||||
|
|
|
|||
|
|
@ -209,11 +209,20 @@ def on_full_sync_timer(mw: aqt.main.AnkiQt, label: str) -> None:
|
|||
return
|
||||
sync_progress = progress.full_sync
|
||||
|
||||
# If we've reached total, show the "checking" label
|
||||
if sync_progress.transferred == sync_progress.total:
|
||||
label = tr.sync_checking()
|
||||
|
||||
total = sync_progress.total
|
||||
transferred = sync_progress.transferred
|
||||
|
||||
# Scale both to kilobytes with floor division
|
||||
max_for_bar = total // 1024
|
||||
value_for_bar = transferred // 1024
|
||||
|
||||
mw.progress.update(
|
||||
value=sync_progress.transferred,
|
||||
max=sync_progress.total,
|
||||
value=value_for_bar,
|
||||
max=max_for_bar,
|
||||
process=False,
|
||||
label=label,
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue