anki/qt
Damien Elmes dac532953e
Refactor progress handling (#2549)
Previously it was Backend's responsibility to store the last progress,
and when calling routines in Collection, one had to construct and pass
in a Fn, which wasn't the most ergonomic. This PR adds the last progress
state to the collection, so that the routines no longer need a separate
progress arg, and makes some other tweaks to improve ergonomics.

ThrottlingProgressHandler has been tweaked so that it now stores the
current state, so that callers don't need to store it separately. When
a long-running routine starts, it calls col.new_progress_handler(),
which automatically initializes the data to defaults, and updates the
shared UI state, so we no longer need to manually update the state at
the start of an operation.

The backend shares the Arc<Mutex<>> with the collection, so it can get
at the current state, and so we can update the state when importing a
backup.

Other tweaks:

- The current Incrementor was awkward to use in the media check, which
uses a single incrementing value across multiple method calls, so I've
added a simpler alternative for such cases. The old incrementor method
has been kept, but implemented directly on ThrottlingProgressHandler.
- The full sync code was passing the progress handler in a complicated
way that may once have been required, but no longer is.
- On the Qt side, timers are now stopped before deletion, or they keep
running for a few seconds.
- I left the ChangeTracker using a closure, as it's used for both importing
and syncing.
2023-06-19 13:48:32 +10:00
..
aqt Refactor progress handling (#2549) 2023-06-19 13:48:32 +10:00
bundle Continue with install if old installer fails 2023-05-29 15:07:44 +10:00
icons move remaining Filter button items into sidebar 2021-02-05 18:58:22 +10:00
mac Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
tests Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
tools Add add-on installation hooks (#2523) 2023-05-29 19:47:49 +10:00
.isort.cfg Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
README.md minor doc updates 2020-12-11 22:37:12 +10:00
runanki.py get PyQt working directly with ./run on macOS 2021-10-16 18:07:29 +10:00

README.md

Python's Qt GUI is in aqt/