Commit graph

10007 commits

Author SHA1 Message Date
Damien Elmes
330e770dec Fix automatically-buried cards not being included in toggle bury 2023-02-22 13:12:35 +10:00
Damien Elmes
45e571973a Bump version 2023-02-22 13:10:06 +10:00
Matthias Metelka
bc20a524b5 Adjust lifecycleHooks.setup to allow async callbacks (#2388) 2023-02-22 11:38:58 +10:00
Hikaru Y
d75ab2f854 Fix type box losing focus when switching IMEs (#2390) 2023-02-22 11:32:16 +10:00
Fabricio Duarte
103ec77e65 Fix deck options selector not updating the current entry sometimes (#2387) 2023-02-20 22:02:46 +10:00
Damien Elmes
bcd676b6fe Update translations 2023-02-20 18:51:50 +10:00
RumovZ
fe8995e1a6 Add option to tag notes with missing media (#2379)
* Keep track of notes with missing media files

* Add option to tag notes with missing media

* Update ftl/core/media-check.ftl (dae)
2023-02-20 18:48:09 +10:00
Matthias Metelka
f8b90cb9ea Add missing Qt styles for disabled state (#2386)
* Add missing styles for disabled state

* Update aqt.rs
2023-02-20 18:27:12 +10:00
Hikaru Y
3f7ba84888 Partially fix slow editor startup (#2382)
The variable 'collapsed' was initialized with the value 'false' because
the initial value of the store 'size' was 'undefined'. This caused an
instance of CodeMirror to be created at editor startup, regardless of
whether the option 'Use HTML editor by default' was enabled, which
significantly slowed down the startup of the editor, especially when
there were many fields in the notetype.
2023-02-20 18:23:42 +10:00
Fabricio Duarte
4dd151eb11 Fix HTML editor hiding when selected as default (#2377) 2023-02-20 18:15:21 +10:00
RumovZ
f2c20a4ee5 Revert backwards incompatible changes to TTSVoice (#2378) 2023-02-20 17:43:18 +10:00
Damien Elmes
c0bde99eef Bump version 2023-02-17 22:51:49 +10:00
Damien Elmes
002fc7af38 Trigger rebuild on STRINGS_JSON change 2023-02-17 19:03:33 +10:00
Damien Elmes
34e829ba5b Update translations 2023-02-17 13:19:34 +10:00
Damien Elmes
02428fdb98 Fix card ease being reset on schema upgrade
9783f4c46a introduced a serious regression,
causing cards to be reset to the default ease when upgrading to the latest
schema version. This could also be triggered when exporting a colpkg with
legacy support.
2023-02-17 12:27:19 +10:00
RumovZ
0b57e92397 Implement TTS using windows crate (#2371)
* Implement TTS using windows crate

* Use API calls instead of SSML

* Properly stop player in case of TTS error

* Add context to WindowsErrors

* Validate available voices

* Remove TTS text from synthesize error

* Limit maximum buffer size

* Make validation optional and list it in tts filter

* We no longer need the winrt module (dae)

* Use a separate request object so the meaning of the bool is clear (dae)

* Slightly shorten runtime error message (dae)

The default message appears to clip slightly.

* Alternate buffer implementation (dae)

* Use array instead of vec

* Drop the max buffer size to 128k (dae)
2023-02-17 12:26:07 +10:00
RumovZ
42f9fdea8b Deck scoped dupe check (#2372)
* Support limiting dupe check to deck

* Expose deck limiting dupe check on frontend

* Make CSV dupe options configurable with headers

* Rename duplicate file headers

* Change dupe check limit to enum
2023-02-16 17:53:36 +10:00
Damien Elmes
34f61ebe4e Bump werkzeug version
Fixes CVE-2023-23934
2023-02-16 17:41:25 +10:00
Damien Elmes
6158912451 Handle the case where win32com.client fails to import
Hopefully fixes the "no attribute 'Flags'" issue:

https://forums.ankiweb.net/t/technical-issue-with-anki-desktop/27089
2023-02-16 17:41:25 +10:00
Damien Elmes
e34ca762fe Allow using the bundled mpv for testing on Windows 2023-02-16 17:41:25 +10:00
evandrocoan
ddf6b646de Create the hook will_show_web to control html5 media elements with Javascript (#2340)
* Replaced ankimedia object directly call by addon specific hook

# Conflicts:
#	qt/aqt/browser/previewer.py
#	qt/aqt/clayout.py
#	qt/aqt/reviewer.py

* Replaced ankimedia.js by addon specific hook

# Conflicts:
#	qt/aqt/browser/previewer.py
#	qt/aqt/clayout.py
#	qt/aqt/main.py

* Create specific location name for each hook to reuse control

* Created the card_review_webview_did_init hook

* Extended the hook card_will_show to replace will_show_web

The new hook card_will_show_state takes three new arguments

* Created the hook audio_did_pause_or_unpause to replace will_show_web

The new hook is called when audio toggle pause is called

* Created the hook audio_will_replay to replace will_show_web

The new hook is called when the audio is replayed by the user.

* Created the hook previewer_will_redraw_after_show_both_sides_toggled

to replace will_show_web.
The new hook fully replaces the last uses of will_show_web.

* Replaced card_will_show_state hook with reviewer_did_init and

equivalents. Instead of receiving the required state, it access it
by caching the object values with hooks as reviewer_did_init.
2023-02-13 14:50:26 +10:00
Damien Elmes
9066eb8e89 Fix yarn install failing if node binary unavailable
The paths we were using were relative, and were breaking if cwd is
changed.
2023-02-10 15:11:36 +10:00
Damien Elmes
804bccfbe7 Fix excess missed markers in non-Latin text 2023-02-10 15:11:36 +10:00
Aristotelis
4bce19b325 Rework & unify webview identification and title setting (#2366)
* Create common web view registry and unify title setting

* Consistently use space-separated naming for webview titles

None of the modified titles seem to be in use by add-ons, so we are not bound to the current naming.

The old naming was likely following camelCase as the name was also acting as a key for saveGeom, which is no longer the case.

* Update webview_did_inject_style_into_page example

* Add docstring to addon-targeted method

* Change AnkiWebView.origin to property

* Fix dupe enum value

* Tweak method name

* Add semicolon

* Rename `AnkiWebViewOrigin` to `AnkiWebViewKind`
2023-02-10 14:53:11 +10:00
Damien Elmes
4e58281a70 Allow the network timeout to be customized
https://forums.ankiweb.net/t/local-sync-server-collection-exceeds-size-limit/27183/7
2023-02-08 14:33:02 +10:00
RumovZ
92742a1e74 Improve HttpError mapping (#2370)
* Use reqwest From impl in HttpError From impl

* Map timeouts to NetworkError (dae)
2023-02-08 12:54:42 +10:00
Damien Elmes
fa603db3f7 Show custom data in stats screen
https://forums.ankiweb.net/t/feature-request-display-custom-data-in-card-info/27187
2023-02-07 12:27:43 +10:00
Damien Elmes
85543f5712 Update translations 2023-02-07 11:59:53 +10:00
Damien Elmes
3308ccd438 Don't enforce download size on client
https://forums.ankiweb.net/t/local-sync-server-collection-exceeds-size-limit/27183/6
2023-02-07 11:58:07 +10:00
RumovZ
6f1e55d1ef Add Rust bin to deprecate unused ftl entries (#2364)
* Add Rust bin to deprecate unused ftl entries

* Align function names with bin names

* Support passing in multiple ftl roots

* Use source instead of jsons for deprecating

* Fix CargoRun not working more than once (dae)

* Add ftl:deprecate (dae)

* Deprecate some strings (dae)

This is not all of the strings that are currently unused

* Check json files before deprecating; add allowlist (dae)

The scheduler messages we'll probably want to reuse for the v2->v3
transition, so I'd prefer to keep them undeprecated for now.

* Deprecate old bury options (dae)

* Support gathering usages from Kotlin files for AnkiDroid (dae)

* Update json scripts (dae)

* Remove old deprecation headers

* Parameterize JSON roots to keep

* Tweak deprecation message (dae)
2023-02-07 11:56:14 +10:00
RumovZ
682bf8ce46 Disable burying of previously gathered cards (#2361)
* Enforce hierarchical bury modes

Interday learning burying is only allowed if review burying is enabled
and review burying is only allowed if new burying is enabled.
Closes #2352.

* Switch front end to new bury modes

* Wording tweaks (dae)

* Hide interday option if using v2 scheduler (dae)
2023-02-06 12:02:27 +10:00
Damien Elmes
3f304dccab Deck-specific limits should be ignored when the v2 scheduler is enabled
Closes #2365
2023-02-06 11:02:26 +10:00
RumovZ
c2dbf486c7 Support UTF-8-BOM when importing CSV (#2360)
The csv crate already supports it, but the meta line parsing didn't.
2023-02-05 11:53:21 +10:00
Damien Elmes
d928b34243 Protobufjs fixed the relative path issue 2023-02-03 09:31:42 +10:00
Damien Elmes
fa322988e8 Fix comparison being collapsed when extra characters in input 2023-02-02 19:13:12 +10:00
Damien Elmes
81ad253225 Revert to blanking out missed chars in provided text
Quite a few users seem surprised to have missed characters appear in
their input text
2023-02-02 19:13:11 +10:00
Damien Elmes
47707e8042 Wrap expected text in code block when no answer provided 2023-02-02 18:01:23 +10:00
Damien Elmes
ece97d35a7 Update protobufjs to remove transitive dependency on taffydb
Fixes CVE-2019-10790

This required the addition of -p proto due to
https://github.com/protobufjs/protobuf.js/issues/1855
2023-02-02 17:43:25 +10:00
Damien Elmes
836349f11c Update translations 2023-02-01 19:48:11 +10:00
Damien Elmes
8c0d804be3 Bump version 2023-02-01 19:47:49 +10:00
evandrocoan
679b4810a0 Trimmed whitespaces on qt/tools/genhooks_gui.py 2023-01-30 19:23:47 +10:00
Kaben Nanlohy
d1cc124446 Allow burying cards in browser (#2351)
* Allow burying cards in browser

This code is based on existing "toggle suspend" command in browser.

- Adds "toggle bury" command to browser cards menu.
- Adds "browsing-toggle-bury" to core translation. Only english-language.
- Adds "buried" coloring to rows for buried cards in browser table.

Not yet done:

- Keyboard shortcut for "toggle bury" action.
- Non-english translations.

* Add contributor as requested in CONTRIBUTORS.

* Fix formatting in browser_table.rs.

* Add keyboard shortcut to "toggle bury" command.

This adds keyboard shortcut "ctrl-shift-j" to "toggle bury" command in
browser cards menu.

* Simplify logic for color of buried-card rows.
2023-01-30 19:21:06 +10:00
Fabricio Duarte
49090e9ab3 Bind entry value to select component in deck config selector (#2354) 2023-01-29 15:16:14 +10:00
evandrocoan
f9c3b0000d Improve info message (#2343) 2023-01-29 12:55:01 +10:00
Damien Elmes
fe136e7be8 Fix error shown after toggling full screen
https://forums.ankiweb.net/t/anki-2-1-57-beta/26494/62
2023-01-29 12:41:28 +10:00
Damien Elmes
69c9c66694 Skip answer comparison if the user didn't type anything 2023-01-28 21:54:16 +10:00
Damien Elmes
b9576f9779 Ensure values clamped when using mousewheel/arrow keys
Closes #2298
2023-01-28 21:54:16 +10:00
Damien Elmes
3d910eadfd Make SpinBox types more specific, and add default max value. 2023-01-28 21:54:16 +10:00
Damien Elmes
9483775984 Fix DailyLimits passing undefined values into SpinBox
If the type says it's a number, we should ensure it's a number :-)

This also fixes fields being empty when they contain a 0 value.
2023-01-28 21:54:16 +10:00
Damien Elmes
9783f4c46a Validate and clamp deck config when loading
Fixes #2353
2023-01-28 21:51:47 +10:00