Commit graph

743 commits

Author SHA1 Message Date
Damien Elmes
dc6471ad40 fetch stock notetypes from backend 2020-05-15 17:08:24 +10:00
Damien Elmes
fd9fc8701c add back card deletion count
cheaper to look up now that there's an index on notes.mid
2020-05-15 15:28:07 +10:00
Damien Elmes
91e71ae044 show (Deck) when card hasn't been added 2020-05-15 15:01:28 +10:00
Damien Elmes
1769cef549 when previewing cards, use the default deck for now
Replay code needs to be able to retrieve deck options. We should
probably use the current deck or pass it in in the future.
2020-05-15 14:50:57 +10:00
Damien Elmes
548f266618 update replay suppression in clayout 2020-05-15 14:26:00 +10:00
Damien Elmes
6c4d6ad933 track changes in fields dialog as well
And avoid bumping schema until user actually saves, but warn at
start.
2020-05-15 13:59:44 +10:00
Damien Elmes
8b7ba99f6e no longer need to check addNote's return value 2020-05-14 21:59:42 +10:00
Damien Elmes
8dcb7fd2ba check for empty cloze cards when rendering as well 2020-05-14 21:56:45 +10:00
Damien Elmes
6dd31341f8 add "fill empty" checkbox 2020-05-14 20:58:45 +10:00
Damien Elmes
aed2eb2cc2 update Add Field button 2020-05-14 18:01:15 +10:00
Damien Elmes
4c52d41632 use group box instead of tabs in card layout screen 2020-05-14 17:26:40 +10:00
Damien Elmes
b2b33d9ad8 start reworking card layout screen
- front/back/css shown in tabs
- front/back preview switchable; only one webview needs to be loaded
- dropdown to select cloze number in preview
- search box to search in front/back/css
2020-05-14 15:24:29 +10:00
Damien Elmes
4a00ad075c drop availOrds(), and use backend for getting cloze numbers 2020-05-14 12:14:00 +10:00
Damien Elmes
b08613e37d remove obsolete preview code 2020-05-14 09:22:53 +10:00
Damien Elmes
257e893d95 update the card layout screen
- changes are now committed in bulk when closing the dialog,
and can be canceled
- it's not necessary to save the note to the database to preview it
- duplicate fields are now shown as duplicates in the top list
- redraw preview more quickly
- use + instead of _ when deduplicating names, as the latter is a
glob character
2020-05-13 17:24:49 +10:00
Damien Elmes
4815010da0 don't hide static template text when card is empty 2020-05-13 11:17:44 +10:00
Damien Elmes
21ac2c14a7 handle scheduling preferences in the backend 2020-05-12 21:13:34 +10:00
Damien Elmes
d7f9bccd1e rewrite DB check
- notes with wrong field count are now recovered instead of
being deleted
- notes with missing note types are now recovered
- notes with missing cards are now recovered
- recover_missing_deck() still needs implementing
- checks required
2020-05-12 21:13:34 +10:00
Damien Elmes
667f9e6554 bulk tag add/remove/update; canonify on note save
also remove the tag list updated hook - we'll need a better solution in
the future than having the library code call back into the GUI code
2020-05-12 21:13:34 +10:00
Damien Elmes
0a87b1ef2c support disabling unicode normalization in notes 2020-05-12 21:13:34 +10:00
Damien Elmes
866231f661 add pep8 name for findReplace 2020-05-12 21:13:34 +10:00
Damien Elmes
70e404b517 update extract-po-string to handle plurals again 2020-05-12 21:13:34 +10:00
Damien Elmes
8c04718541 update find&replace in browser
sadly the UI still stutters on large selections - the calls
to get the selected rows from Qt are really slow.
2020-05-12 21:13:34 +10:00
Damien Elmes
6b4a40f774 catch schema mod in background
If the schema confirmation dialog is shown on a background thread it
will crash the app, so we convert this to an assertion error that gets
caught by the error handler. Code still needs to be updated to modify
the schema prior to moving to the background, but at least this way
it doesn't crash.
2020-05-12 21:13:34 +10:00
Damien Elmes
b757d3db65 check untyped in clayout 2020-05-12 21:13:34 +10:00
Damien Elmes
1a6e28a05d remove an unused import 2020-05-12 21:13:34 +10:00
Damien Elmes
2641862b56 update fields and models diags
- field changes are now applied when user closes dialog with save
button, in bulk
- models diag now fetches note type and saves it as required, instead
of holding on top a copy that can grow stale as changes are made in
subdialogs
- both dialogs now perform operations in the backend
- note.model() now fetches the note type on the fly, instead of
holding on to a copy that may become stale
2020-05-12 21:13:34 +10:00
Damien Elmes
a21e2abca0 add helper to run background task with progress 2020-05-12 21:13:34 +10:00
Damien Elmes
2b937acf29 reuse existing use count in note types screen 2020-05-12 21:13:33 +10:00
Damien Elmes
0bab292ff5 mypy/isort fixes 2020-05-12 21:13:33 +10:00
Damien Elmes
7ef72aba04 use the backend for the deck due tree
- approx 3x faster on a large test deck
- counts are no longer capped to 1000 in the tree
2020-05-12 21:13:33 +10:00
Damien Elmes
97e857a41c add browserCollapsed as part of tree build 2020-05-12 21:13:33 +10:00
Damien Elmes
1d01418b21 fix mypy issues 2020-05-12 21:13:33 +10:00
Damien Elmes
13d23cd24b speed up browser load by rendering deck tree in Rust and skipping counts 2020-05-12 21:13:33 +10:00
Damien Elmes
016fdd30ef ensure collection doesn't get stuck open if loading fails 2020-05-12 21:13:33 +10:00
Damien Elmes
4aac9635fa catch template errors, and start on discarding changes to fields/cards
This is only a first step - all the current methods that implicitly
save need to be updated.
2020-05-12 21:13:33 +10:00
Damien Elmes
d1cc4684d2 hook the empty cards code up to the GUI 2020-05-12 21:13:33 +10:00
Damien Elmes
6350e18680 hook up new note and note type handling
- notetypes are fetched from the DB as needed, and cached in Python
- handle note type changes in the backend. Multiple operations can now
be performed in one go, but this is not currently exposed in the GUI.
- extra methods to grab sorted note type names quickly, and fetch by
name
- col.models.save() without a provided notetype is now a no-op
- note loading/saving handled in the backend
- notes with no valid cards can now be added
- templates can now be deleted even if they would previously
orphan notes

a number of fixmes have been left in notes.py and models.py
2020-05-12 21:13:33 +10:00
Damien Elmes
e1642c7277 use quick check instead of full integrity check on collection close 2020-05-12 21:13:33 +10:00
Damien Elmes
8b7c474642 avoid installing pyaudio on every run 2020-05-12 21:10:21 +10:00
Damien Elmes
9762132f10 Merge pull request #611 from evandroforks/automatically_install_pyaudio_on_make_check
Automatically install pyaudio when running make check
2020-05-12 20:44:25 +10:00
Damien Elmes
27d2fb148a bump version 2020-05-11 19:28:17 +10:00
Damien Elmes
76890191c5 Revert "use isolation characters instead of direction markers in cloze handling"
This reverts commit 79a50ffb91.

Caused a regression:

https://anki.tenderapp.com/discussions/ankidesktop/41384-cloze-deletions-in-2125-and-2126
2020-05-11 19:25:49 +10:00
evandrocoan
6d07ad653b Automatically install pyaudio when running make check 2020-05-09 13:26:42 -03:00
Damien Elmes
ece19da49a avoid renaming completer_, as add-ons depend on it 2020-05-08 18:17:57 +10:00
Damien Elmes
cad3d9e74d python formatting+lints 2020-05-08 17:30:27 +10:00
Damien Elmes
5557a13a85 stats area grouping box fix
https://anki.tenderapp.com/discussions/beta-testing/1928-cosmetic-issue
2020-05-08 16:03:29 +10:00
Damien Elmes
0cb4bb7a78 bundle socks
https://anki.tenderapp.com/discussions/ankidesktop/39801-sync-error
2020-05-08 15:26:19 +10:00
Damien Elmes
9ab0f7e2c8 avoid mention of pip 2020-05-05 16:30:22 +10:00
Damien Elmes
9c05ceb357 benchmark->profile, and remove from error branches 2020-05-05 16:28:49 +10:00