Commit Graph

836 Commits

Author SHA1 Message Date
Damien Elmes
f23eb350e4 drop availOrds(), and use backend for getting cloze numbers 2020-05-14 12:14:00 +10:00
Damien Elmes
c601dcef24 remove obsolete preview code 2020-05-14 09:22:53 +10:00
Damien Elmes
6680cdf1d3 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
12b8fe6147 don't hide static template text when card is empty 2020-05-13 11:17:44 +10:00
evandrocoan
3f517c71e4 Remove unused t = time.time() variable on qt/aqt/browser.py 2020-05-12 15:09:22 -03:00
evandrocoan
f8c6300e27 Also fix legacy.py::anki.sound._soundReg accepting empty tags 2020-05-12 12:43:35 -03:00
Damien Elmes
9317cee9ba handle scheduling preferences in the backend 2020-05-12 21:13:34 +10:00
Damien Elmes
70cc1699a6 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
2413f286b1 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
7bab99d873 support disabling unicode normalization in notes 2020-05-12 21:13:34 +10:00
Damien Elmes
05ca797ee6 add pep8 name for findReplace 2020-05-12 21:13:34 +10:00
Damien Elmes
29379a9a50 update extract-po-string to handle plurals again 2020-05-12 21:13:34 +10:00
Damien Elmes
1852e32183 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
c51ca666c3 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
6e6d9ee1a3 check untyped in clayout 2020-05-12 21:13:34 +10:00
Damien Elmes
9f585d4d38 remove an unused import 2020-05-12 21:13:34 +10:00
Damien Elmes
25f122bf5c 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
f6931197d2 add helper to run background task with progress 2020-05-12 21:13:34 +10:00
Damien Elmes
36c1d1cf8c reuse existing use count in note types screen 2020-05-12 21:13:33 +10:00
Damien Elmes
ce104d16a3 mypy/isort fixes 2020-05-12 21:13:33 +10:00
Damien Elmes
238441f2d9 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
67421e02ec add browserCollapsed as part of tree build 2020-05-12 21:13:33 +10:00
Damien Elmes
a0160d7f1e fix mypy issues 2020-05-12 21:13:33 +10:00
Damien Elmes
a88bc1e836 speed up browser load by rendering deck tree in Rust and skipping counts 2020-05-12 21:13:33 +10:00
Damien Elmes
0bb80329e8 ensure collection doesn't get stuck open if loading fails 2020-05-12 21:13:33 +10:00
Damien Elmes
23586ffe90 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
6e8860cafa hook the empty cards code up to the GUI 2020-05-12 21:13:33 +10:00
Damien Elmes
f637ac957d 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
1ca7fb4a80 use quick check instead of full integrity check on collection close 2020-05-12 21:13:33 +10:00
Damien Elmes
85b28f13d2 avoid installing pyaudio on every run 2020-05-12 21:10:21 +10:00
Damien Elmes
436bdd6970
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
74c97ad6d3 bump version 2020-05-11 19:28:17 +10:00
Damien Elmes
4e44694136 Revert "use isolation characters instead of direction markers in cloze handling"
This reverts commit e838769d02.

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
5f9dbf9b7d Set to restart Anki application after profile directory migration
Ask user confirmation before moving the Anki directory
https://github.com/ankitects/anki/pull 610
2020-05-10 18:30:58 -03:00
evandrocoan
4cf64519fb Automatically install pyaudio when running make check 2020-05-09 13:26:42 -03:00
Damien Elmes
7078415405 avoid renaming completer_, as add-ons depend on it 2020-05-08 18:17:57 +10:00
Damien Elmes
c02716ccd8 python formatting+lints 2020-05-08 17:30:27 +10:00
Damien Elmes
2a0d40e15d 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
4a26e2ba77 bundle socks
https://anki.tenderapp.com/discussions/ankidesktop/39801-sync-error
2020-05-08 15:26:19 +10:00
evandrocoan
9f5c69ee94 Keep an window open showing the migration is in progress 2020-05-07 15:03:43 -03:00
evandrocoan
453da45c99 Ask user confirmation before moving the Anki directory
https://anki.tenderapp.com/discussions/ankidesktop/41245-unwanted-file-movingdeleting-behavior
2020-05-07 14:59:19 -03:00
Damien Elmes
961833a137 avoid mention of pip 2020-05-05 16:30:22 +10:00
Damien Elmes
2f57c646e0 benchmark->profile, and remove from error branches 2020-05-05 16:28:49 +10:00
Damien Elmes
e7ebcc7c75
Merge pull request #605 from evandroforks/benchmark_option
Created the --benchmark command line option
2020-05-05 16:23:00 +10:00
Damien Elmes
16d0bf24b4
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
0006269c01 Used showWarning asking the user to install pyaudio 2020-05-05 00:00:48 -03:00
evandrocoan
338e904bd4 Created the ANKI_RUN_BENCHMARK environment variable replacing
the command line argument.
2020-05-04 23:46:13 -03:00
evandrocoan
2e11a596aa Fixed profiler word misspelling and stopped trimming the output 2020-05-04 23:15:23 -03:00
Damien Elmes
08f894735a
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
b932333246 fix card layout screen on qt 5.9 regression (#592) 2020-05-05 11:26:13 +10:00
evandrocoan
b671c8e627 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
5236e20a7a
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
9502fe790f
Merge pull request #584 from Arthur-Milchior/onModelchangeUsed
On modelchange used
2020-05-04 14:06:35 +10:00
Damien Elmes
6c20e5a7df
Merge pull request #585 from Arthur-Milchior/addButtonSaveNewFunction
addButton always save function
2020-05-04 13:58:46 +10:00
Damien Elmes
d98e3fa371
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
eec3fcf87a 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
164fdb37d5 fix saving searches in browser 2020-05-04 12:26:50 +10:00
evandrocoan
1e4748d45e 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
b63bfc83d8 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
f2fbf667cd onModelChange: replacing try by if 2020-05-03 01:53:00 +02:00
Arthur Milchior
d427e1028b single try in onModelChange 2020-05-03 01:53:00 +02:00
Arthur Milchior
936bb31997 onModelChange save note
I like the way onModelChange is done. Except that you forget to use
the note you computed.
2020-05-03 01:53:00 +02:00
Damien Elmes
b337dda8df bump version 2020-05-02 10:22:00 +10:00
evandrocoan
a48fa4ad87 Add missing aqt and anki modules dependency requirements 2020-04-30 17:30:22 -03:00
Damien Elmes
9645b85df8 fix deck confs not deleting
https://anki.tenderapp.com/discussions/ankidesktop/41044-bug-report-anki-2124-macos-deleting-unused-option-groups
2020-04-30 08:10:29 +10:00
BlueGreenMagick
be6a5e2f13 Set tab width to 4 spaces
setTabStopWidth is deprecated, and setTabStopDistance is preferred
It's not entirely accurate however, which you can see
when you compare 10 tabs and 40 spaces
2020-04-29 11:34:09 +09:00
Damien Elmes
00cf4fc585 bump version 2020-04-28 08:57:56 +10:00
Arthur Milchior
3378daeca3 remove an useless asignment
Because fields of new notes are empty by default
2020-04-28 00:31:30 +02:00
Arthur Milchior
93d83e760b remove a try, for code clarity 2020-04-28 00:31:24 +02:00
Damien Elmes
0c8f6ced09 Revert "Merge pull request #583 from Arthur-Milchior/remove_a_try"
This reverts commit e9ca61d1eb, reversing
changes made to abb80231a5.
2020-04-28 07:38:23 +10:00
Arthur Milchior
e86817305a mw.debug_diag is the dialog and not the window
This will allow, for example, for add-ons to do self.debugDiag.text
and access the debugger text. I see very little reason to have a
direct access to the dialog window.

I should note that self.debugDiag is never used anywhere in the code,
so I think it should be deleted; unless you've heard of some add-on
using it.
2020-04-27 11:55:33 +02:00
Damien Elmes
e9ca61d1eb
Merge pull request #583 from Arthur-Milchior/remove_a_try
Simplify the code slightly
2020-04-27 19:12:00 +10:00
Damien Elmes
abb80231a5
Merge pull request #582 from evandroforks/fix_make_clean
Fixed make clean rule not working on Windows
2020-04-27 19:10:21 +10:00
Damien Elmes
5746302817
Merge pull request #581 from BlueGreenMagick/use-var-name
use variable names
2020-04-27 19:10:04 +10:00
Arthur Milchior
31164adaec addButton always save function 2020-04-26 17:01:47 +02:00
Arthur Milchior
e4a0ccc059 remove an useless asignment
Because fields of new notes are empty by default
2020-04-26 14:49:16 +02:00
Arthur Milchior
1771be8f1e remove a try, for code clarity 2020-04-26 14:49:11 +02:00
BlueGreenMagick
f23a361876 use variable names 2020-04-26 15:47:19 +09:00
evandrocoan
26480fb13c Fixed make clean rule not working on Windows 2020-04-26 03:02:02 -03:00
evandrocoan
06056236c0 Fixed build-mo-files not failing the build when msgmerge
is not found:
https://github.com/ankitects/anki/runs/617116053?check_suite_focus=true#step:27:1244

The build was not falling because when you do `(commands)` in a
shell script, the `set -e` directive is not inherited. Then, either
do not start a new shell or just use an if to test the error condition.
2020-04-25 05:17:24 -03:00
Damien Elmes
361959bdc4
Merge pull request #573 from evandroforks/printWidth100
Set .prettierrc printWidth to 88 because the default is too short
2020-04-23 20:01:58 +10:00
evandrocoan
51ec5d0fa9 Set .prettierrc printWidth to 88 because the default is too short 2020-04-22 23:11:03 -03:00
Damien Elmes
4b8cf631d5 add selectable flag while preserving link clicking
https://anki.tenderapp.com/discussions/beta-testing/1920-config-can-copy-paste-but-cant-click-links-now
2020-04-21 09:11:56 +10:00
Damien Elmes
ce589fb975 Revert "Merge pull request #562 from ijgnd/master"
This reverts commit 4fb9dc734b, reversing
changes made to c8fb409a49.

https://anki.tenderapp.com/discussions/beta-testing/1920-config-can-copy-paste-but-cant-click-links-now
2020-04-21 09:10:45 +10:00
Damien Elmes
683f664d85 fix deleting deck configs 2020-04-20 13:23:05 +10:00
Damien Elmes
335815ab9c fix renaming not updating dropdown 2020-04-20 13:17:55 +10:00
Damien Elmes
c023bdd78e fix adding deck configs 2020-04-20 13:15:23 +10:00
Damien Elmes
385dbf88c3
Merge pull request #569 from evandroforks/limit_error_message_size
Also limit the size of the error message
2020-04-20 11:14:53 +10:00
Damien Elmes
2939931004 split scheduling prefs into separate tab
https://anki.tenderapp.com/discussions/ankidesktop/40610-windows-anki-everything-was-enlarged-to-150
https://anki.tenderapp.com/discussions/beta-testing/1916-preferences-screen-partly-invisible
2020-04-20 11:11:00 +10:00
evandrocoan
9dda28def4 Also limit the size of the error message in case it is
build by a concatenation of stack traces, i.e.,
```js
throw new Error(err + err.stack)
```
2020-04-17 16:28:31 -03:00
evandrocoan
67a8af0cbf Limit the reviewer.ts stack size
https://anki.tenderapp.com/discussions/beta-testing/1918-reliably-reproduced-bug-in-2124beta6#comment_48247959
2020-04-17 03:53:15 -03:00
evandrocoan
38fabcef52 Cache webview.py console regex expression and disable multiline 2020-04-17 03:43:16 -03:00
Damien Elmes
aa562f490c fix delays caused by console.log regression in PR #560
https://anki.tenderapp.com/discussions/beta-testing/1918-reliably-reproduced-bug-in-2124beta6
2020-04-17 10:51:03 +10:00
Damien Elmes
394f7c630c
Merge pull request #560 from evandroforks/fix_javascript_console_output
Fixed javaScriptConsoleMessage showing 'error on line'
2020-04-16 10:15:56 +10:00
Damien Elmes
4fb9dc734b
Merge pull request #562 from ijgnd/master
make help text selectable
2020-04-16 10:14:02 +10:00
Damien Elmes
a7d5d27778 catch and report issues when downgrading 2020-04-16 10:11:16 +10:00
Damien Elmes
07343f6c9f show a clearer error if the schema is too new
will hold off on making it translatable for now
2020-04-16 09:47:34 +10:00
Damien Elmes
d24cb66be9 downgrade manually
- A regular collection open/close no longer goes through the
upgrade/downgrade steps each time. This avoids wasted cycles, and will
become more important in the future when decks and note types are
split into separate tables.
- Added a downgrade button to the profiles screen to downgrade all
profiles and close the app.
- Downgrading is still automatic when exporting/doing a full sync.
2020-04-16 09:00:49 +10:00
Damien Elmes
a6b676039b work around full sync on start closing the app
This is just a temporary solution until the syncing code can be
reworked.

https://anki.tenderapp.com/discussions/ankidesktop/39761-anki-crashing-after-sync-and-download
2020-04-16 08:10:17 +10:00
evandrocoan
2f174b40a6 Set to use a regular expression to remove the server name because
it is less prone to break in future updates.
2020-04-15 16:27:41 -03:00
evandrocoan
7061aac16d Set to javaScriptConsoleMessage output to stdout because it
may raise error messages on the anki GUI.
2020-04-15 16:06:45 -03:00
ijgnd
e745677145
make help text selectable
This allows the user to copy e.g. values so that they don't have to retype them which might introduce typos.
2020-04-15 18:59:04 +02:00
Damien Elmes
16be20e2fa don't write log files when exporting 2020-04-15 21:45:32 +10:00
Damien Elmes
65cfcf9226 pare back dark mode support
Anki now solely relies on the night mode setting in the preferences
to decide whether to show in light or dark mode. Some users wanted
to run Anki in light mode while keeping the rest of their system dark,
and there were various display problems when dark mode was changed
after Anki started that couldn't be easily worked around.

NSRequiresAquaAppearance is set again, which means we can rely on
the interface appearing properly and not changing as the macOS theme
is changed.

Users who only use dark mode, and preferred the native look of widgets
in dark mode, can achieve the previous appearance by running the
following command in the terminal:

defaults write net.ankiweb.dtop NSRequiresAquaSystemAppearance -bool no

And the following in the debug console:

mw.pm.meta["dark_mode_widgets"] = True

This is hidden behind a debug console command because it requires the
user ensure their system is always set to the same light/dark mode
as Anki.
2020-04-15 21:44:56 +10:00
Damien Elmes
dbedeef98d
Merge pull request #559 from evandroforks/show_full_javascript_stacktrace
Set to show the JavaScript exception message and stacktrace
2020-04-15 18:51:16 +10:00
Damien Elmes
75db74e2e5
Merge pull request #557 from simgunz/fix-button-not-highlighted
Fix editor buttons not highlighted
2020-04-15 18:50:36 +10:00
Damien Elmes
a552abe688 update if a compatible branch is found, even if mtime is wrong
https://anki.tenderapp.com/discussions/ankiweb/4668-addon-auto-update-problems
2020-04-15 18:47:04 +10:00
evandrocoan
16d7e89c7d Set to show the JavaScript exception message and stacktrace, when
a exception is throw, showing the function and lines from where
the exception/error is coming from.
https://stackoverflow.com/questions/591857/how-can-i-get-a-javascript-stack-trace-when-i-throw-an-exception

Exception example:
Invalid HTML on card: Error: The media element is missing its 'src' attribute.
at http://127.0.0.1:50233/_anki/reviewer.js:246:23
at http://127.0.0.1:50233/_anki/reviewer.js:112:9
at Array.forEach ()
at setAnkiMedia (http://127.0.0.1:50233/_anki/reviewer.js:111:11)
at AnkiMediaQueue.setup (http://127.0.0.1:50233/_anki/reviewer.js:244:9)
at eval (eval at (http://127.0.0.1:50233/_anki/jquery.js:2:2651), :2:11)
at eval ()
at http://127.0.0.1:50233/_anki/jquery.js:2:2651
at Function.globalEval (http://127.0.0.1:50233/_anki/jquery.js:2:2662)
at Ha (http://127.0.0.1:50233/_anki/jquery.js:3:21262)
2020-04-15 04:15:47 -03:00
evandrocoan
f3c561b6d9 Fixed javaScriptConsoleMessage showing 'error on line' for
all lines. The new output format is:
JS info /_anki/reviewer.js:166 autoadd
JS error /_anki/reviewer.js:240 Uncaught (in promise) NotAllowedError: play() can only be initiated by a user gesture.
2020-04-15 04:12:47 -03:00
Simone Gaiarin
5410d27aaa Fix editor buttons not highlighted
The selector 'button.linkb' takes precedence on '.highlighted' because
it is more specific, so that '.highlighted' is never applied.
2020-04-14 19:04:03 +02:00
Damien Elmes
351d8a309f move autoplay() into card 2020-04-13 09:04:30 +10:00
Damien Elmes
10eb947402 fix replay audio again, and decouple the code from the reviewer 2020-04-13 08:59:36 +10:00
Damien Elmes
e838769d02 use isolation characters instead of direction markers in cloze handling
https://anki.tenderapp.com/discussions/ankidesktop/40443-improper-location-of-c1foo-on-ltr-text-in-an-rtl-cloze-field
2020-04-13 08:34:17 +10:00
Damien Elmes
0c5f22f4ae avoid adjusting position if selected row is visible
https://anki.tenderapp.com/discussions/beta-testing/1868-anki-2124-beta#comment_48227037
2020-04-11 15:54:52 +10:00
Damien Elmes
698bf9c780
Merge pull request #550 from BlueGreenMagick/debugDiag-contextMenu
add clear actions to context menu in debug console
2020-04-11 14:19:46 +10:00
Damien Elmes
a068fcdc9f
Update main.py 2020-04-11 14:19:27 +10:00
Damien Elmes
8b3f0100e4 fix error when replaying audio in preview screen 2020-04-10 20:33:48 +10:00
Damien Elmes
c964be3961 make sure preview window is closed when browser closed 2020-04-10 20:32:48 +10:00
Damien Elmes
26f5b9250c grey out spinner if max=0
https://anki.tenderapp.com/discussions/ankidesktop/32710-custom-study
2020-04-10 20:32:48 +10:00
Damien Elmes
6776101601
Merge pull request #549 from BlueGreenMagick/debug-resizable
Allow changing height of debug console text edit boxes
2020-04-10 19:46:13 +10:00
BlueGreenMagick
653f5765b8 add clear actions to context menu in debug console 2020-04-10 15:45:25 +09:00
BlueGreenMagick
1452c2fd3c put debug textedits in a splitter 2020-04-10 13:50:09 +09:00
Damien Elmes
8f7ef6ed2c make sure progress stops when collection corrupt message shown 2020-04-09 14:19:20 +10:00
Damien Elmes
eff1b39e9f fix deck_browser_did_render hook 2020-04-09 13:40:19 +10:00
Damien Elmes
3851246d60
Merge pull request #542 from BlueGreenMagick/addcards-cloze-warning
detect cloze cards with other filters
2020-04-08 16:30:00 +10:00
Damien Elmes
cbb2ce6928
Merge pull request #545 from BlueGreenMagick/draggable-field-pos
allow dragging fields to change its position
2020-04-08 16:22:27 +10:00
Damien Elmes
61793f92b8 fix preview closing
https://anki.tenderapp.com/discussions/beta-testing/1868-anki-2124-beta#comment_48228480
2020-04-08 16:21:20 +10:00
Damien Elmes
55b99511c0 print exception on close 2020-04-08 10:05:33 +10:00
BlueGreenMagick
6b3d6bec55 allow dragging fields to change its position 2020-04-07 16:42:33 +09:00
BlueGreenMagick
aa86bc8088 use model type to detect cloze notes 2020-04-07 14:02:53 +09:00
Damien Elmes
6ecf2ffa2c
Merge pull request #543 from Arthur-Milchior/sort_according_to_path
Sort according to path
2020-04-07 14:44:53 +10:00
Damien Elmes
1122ab4791
Merge pull request #541 from BlueGreenMagick/tmpNote-cloze
detect renamed cloze fields in note type preview
2020-04-07 14:17:44 +10:00
Damien Elmes
16ab351bf8 avoid unnecessary work in 'make build' 2020-04-07 10:59:14 +10:00
BlueGreenMagick
12b69af9b2 detect renamed cloze fields in note type preview
and cloze fields that is also other special field type
such as '{{cloze:hint:Text}}'
2020-04-07 08:56:54 +09:00
Arthur Milchior
bda2935de1 _basename to basename, since it's not private in use 2020-04-06 23:51:50 +02:00
Arthur Milchior
5315b717c0 _basename used where possible 2020-04-06 23:51:42 +02:00
Arthur Milchior
69a9425cd0 replace _path by path (because it's not private here) 2020-04-06 23:50:43 +02:00
Arthur Milchior
266c2022b5 uses _path where possible 2020-04-06 23:50:37 +02:00
Arthur Milchior
5d55c4cda2 Sort decks according to their paths
Currently it's sorted alphabetically. Because of this, "A::B" appears
between "A9" and "AA" in list of decks.
2020-04-06 22:49:25 +02:00
Damien Elmes
676f4e74a8 store config in separate DB table
- mtime is tracked on each key individually, which will allow
merging of config changes when syncing in the future
- added col.(get|set|remove)_config()
- in order to support existing code that was mutating returned
values (eg col.conf["something"]["another"] = 5), the returned list/dict
will be automatically wrapped so that when the value is dropped, it
will save the mutated item back to the DB if it's changed. Code that
is fetching lists/dicts from the config like so:

col.conf["foo"]["bar"] = baz
col.setMod()

will continue to work in most case, but should be gradually updated to:

conf = col.get_config("foo")
conf["bar"] = baz
col.set_config("foo", conf)
2020-04-06 15:39:47 +10:00
Damien Elmes
8b76098bc7 omit period in steps when possible 2020-04-06 15:39:47 +10:00
Damien Elmes
7375a0389a add flag to skip downgrade on collection close
Disabled for now; when enabled it will allow faster collection
open and close in the normal case, while continuing to downgrade
when exporting or doing a full sync.

Also, when downgrading is disabled, the journal mode is no longer
changed back to delete.
2020-04-04 17:21:45 +10:00
Damien Elmes
ac4284b2de update tag handling
- tag list stored in a separate DB table
- non-wildcard searches now do full unicode case folding
(eg tag:masse matches 'Maße')
- wildcard matches do simple unicode case folding
- some functions haven't been updated yet, so ascii folding will
continue to be used in some operations
2020-04-03 19:34:46 +10:00
Damien Elmes
333d0735ff preserve mtime/usn when syncing deck config, and add snake_case names 2020-04-03 19:34:46 +10:00
Damien Elmes
2c99a4203f
Merge pull request #537 from Arthur-Milchior/add_card_did_init
hook add_card_did_init
2020-04-03 19:34:33 +10:00
Arthur Milchior
657fa9758b hook add_card_did_init 2020-04-03 11:03:08 +02:00
evandrocoan
4ad03fe4ba Fixed double python version check for python_requires=">=3.7" 2020-04-02 22:56:53 -03:00
evandrocoan
efe319ec95 Deprecated sdist wheels and pyqtwebengine as dependency 2020-04-02 22:56:48 -03:00
evandrocoan
274944e678 Set the minimum python version required by anki on qt/setup.py 2020-04-02 22:56:44 -03:00
evandrocoan
50e9780e66 Set to build a source distribution instead of build distribution
for aqt on qt/Makefile, because .whl files are just zip simple
zip files and do not support dynamic versioning. Also, there is no
restriction for aqt to be shipped as source tarball because it does
not ship any binaries.
2020-04-02 22:56:37 -03:00