ce243c2cae
The existing code was really difficult to reason about: - The default notetype depended on the selected deck, and vice versa, and this logic was buried in the deck and notetype choosing screens, and models.py. - Changes to the notetype were not passed back directly, but were fired via a hook, which changed any screen in the app that had a notetype selector. It also wasn't great for performance, as the most recent deck and tags were embedded in the notetype, which can be expensive to save and sync for large notetypes. To address these points: - The current deck for a notetype, and notetype for a deck, are now stored in separate config variables, instead of directly in the deck or notetype. These are cheap to read and write, and we'll be able to sync them individually in the future once config syncing is updated in the future. I seem to recall some users not wanting the tag saving behaviour, so I've dropped that for now, but if people end up missing it, it would be simple to add as an extra auxiliary config variable. - The logic for getting the starting deck and notetype has been moved into the backend. It should be the same as the older Python code, with one exception: when "change deck depending on notetype" is enabled in the preferences, it will start with the current notetype ("curModel"), instead of first trying to get a deck-specific notetype. - ModelChooser has been duplicated into notetypechooser.py, and it has been updated to solely be concerned with keeping track of a selected notetype - it no longer alters global state.
28 lines
493 B
INI
28 lines
493 B
INI
[MASTER]
|
|
ignore-patterns=.*_pb2.*
|
|
persistent = no
|
|
|
|
[TYPECHECK]
|
|
ignored-classes=
|
|
FormatTimespanIn,
|
|
AnswerCardIn,
|
|
UnburyCardsInCurrentDeckIn,
|
|
BuryOrSuspendCardsIn,
|
|
NoteIsDuplicateOrEmptyOut
|
|
|
|
[MESSAGES CONTROL]
|
|
disable=C,R,
|
|
fixme,
|
|
unused-wildcard-import,
|
|
attribute-defined-outside-init,
|
|
redefined-builtin,
|
|
wildcard-import,
|
|
broad-except,
|
|
bare-except,
|
|
unused-argument,
|
|
unused-variable,
|
|
redefined-outer-name,
|
|
global-statement,
|
|
protected-access,
|
|
arguments-differ,
|