Commit graph

726 commits

Author SHA1 Message Date
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
Damien Elmes
d2448fd957 Merge pull request #605 from evandroforks/benchmark_option
Created the --benchmark command line option
2020-05-05 16:23:00 +10:00
Damien Elmes
c463f1d40b Merge pull request #608 from evandroforks/fix_missing_pyaudio_import
Fix missing pyaudio blocking Anki from running
2020-05-05 16:22:34 +10:00
evandrocoan
682da15862 Used showWarning asking the user to install pyaudio 2020-05-05 00:00:48 -03:00
evandrocoan
9ec62edb2f Created the ANKI_RUN_BENCHMARK environment variable replacing
the command line argument.
2020-05-04 23:46:13 -03:00
evandrocoan
3d737f3329 Fixed profiler word misspelling and stopped trimming the output 2020-05-04 23:15:23 -03:00
Damien Elmes
367a174100 Merge pull request #607 from Arthur-Milchior/remove_a_try
Simplify the copying of field contents when resetting
2020-05-05 11:36:17 +10:00
Damien Elmes
56db996b5c fix card layout screen on qt 5.9 regression (#592) 2020-05-05 11:26:13 +10:00
evandrocoan
73b2c5f45c Fix missing pyaudio blocking Anki from running
https://github.com/ankitects/anki/pull 606
Remove pyaudio as mandatory dependency
2020-05-04 13:44:12 -03:00
Damien Elmes
51331db281 Merge pull request #580 from Arthur-Milchior/debug_diag
mw.debug_diag is the dialog and not the window
2020-05-04 14:07:15 +10:00
Damien Elmes
a2d02697a4 Merge pull request #584 from Arthur-Milchior/onModelchangeUsed
On modelchange used
2020-05-04 14:06:35 +10:00
Damien Elmes
673fe71c7d Merge pull request #585 from Arthur-Milchior/addButtonSaveNewFunction
addButton always save function
2020-05-04 13:58:46 +10:00
Damien Elmes
519b581608 Merge pull request #606 from evandroforks/remove_pyaudio_as_dependency
Remove pyaudio as mandatory dependency
2020-05-04 13:37:19 +10:00
Damien Elmes
4d33b2d8f7 use qconnect everywhere, and fix some typing issues
a step towards check_untyped_defs in aqt, but there's still 100+
issues to resolve
2020-05-04 13:23:08 +10:00
Damien Elmes
5706cdfc2e fix saving searches in browser 2020-05-04 12:26:50 +10:00
evandrocoan
0fb64bcf20 Remove pyaudio as mandatory dependency
Pyaudio on Windows is difficult to install and complicates things
when someone is using the wheels just for autocomletion on IDEs as
PyCharm:
https://anki.tenderapp.com/discussions/add-ons/44009-problems-with-code-completion
2020-05-03 23:05:38 -03:00
evandrocoan
8a516d8541 Created the --benchmark command line option
https://anki.tenderapp.com/discussions/ankidesktop/41106-card-audio-playback-changes-bug-in-212x
Based on the snippet: https://gist.github.com/evandrocoan/961d46e10424e53ba8946fac66e0efac
2020-05-03 20:34:43 -03:00
Arthur Milchior
6309df01f6 onModelChange: replacing try by if 2020-05-03 01:53:00 +02:00