Commit graph

10233 commits

Author SHA1 Message Date
Daniel Tang
476cfe8aeb Fix black on grey deck options on KDE (#2415) 2023-03-06 19:43:04 +10:00
RumovZ
e7890c7033 Export static references from sound tags (#2420) 2023-03-06 19:29:19 +10:00
Abdo
13d6c00a8d Fix packaged audio tools path on Windows (#2419)
There is no audio subfolder as of 2.1.55+
2023-03-06 19:27:08 +10:00
RumovZ
f6fa73f4b3 Global new ignore review limit (#2417)
* Add CardAdder test helper

* Add option to have new cards ignore the review limit

Also entails a lot of refactoring because the old code was deeply
coupled to the previous behaviour.

* Add global option to ignore review limit

* Refactor decrementation

* Unify testing
2023-03-06 19:06:12 +10:00
Damien Elmes
81bff877ea Bump tempfile version to drop old remove_dir_all version
https://rustsec.org/advisories/RUSTSEC-2023-0018
2023-03-06 18:23:19 +10:00
Daniel Tang
f87babb5fc Fix confusion of reduce_motion with minimalist_mode (#2413) 2023-03-06 18:15:43 +10:00
Daniel Tang
1e6686fcd8 Fix panic with invalid sync server URL with port (#2412) 2023-03-03 20:28:11 +10:00
Damien Elmes
515a67d7cd Update translations 2023-03-03 19:35:05 +10:00
Damien Elmes
dba1fd49b8 Ensure good is at least previous+1 even if low hard factor set
https://forums.ankiweb.net/t/anki-scheduler-broken/27987/8
2023-03-03 15:34:08 +10:00
Damien Elmes
adfdfcb238 Passing an invalid profile name on the commandline will now show picker
https://forums.ankiweb.net/t/open-with-profiles-to-start/27612
2023-03-02 17:13:04 +10:00
Damien Elmes
bc684ecaf4 Make some methods/fields public 2023-03-01 19:46:06 +10:00
Damien Elmes
8c340ed1ea Add custom display for SyncError 2023-03-01 19:46:06 +10:00
Damien Elmes
bae48285dc Implement HttpError directly so that sources can be extracted properly
When disabling the default snafu source handling, <dyn Error>.source()
doesn't work.
2023-03-01 19:46:06 +10:00
Damien Elmes
4759343f25 Refactor MediaIter
Removes the dependency on a local path, and allows the unicode checks
to be skipped if appropriate.
2023-03-01 18:57:48 +10:00
Damien Elmes
119dc0ea14 Allow .or_http_err() to work with anyhow 2023-03-01 18:54:01 +10:00
Fabricio Duarte
76992445e2 Fix double scrollbars in deck options (#2406)
* Fix double scrollbars in deck options

* Remove !important

Future pages may want to override overflow-x (?) and it doesn't seem to change anything for now.

* Allow the body to expand vertically in the import CSV page
2023-02-28 15:57:06 +10:00
Damien Elmes
080d150440 Fix images with non-Latin text and commas failing to display
Flask's .send_file() method sends a content-disposition header based
on the filename. If the filename includes non-Latin text, it adds an
rfc5987 unicode filename, but does not percent-escape the commas.
This causes Chromium to fail to load the image with the following
error:

net::ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION

 curl -v http://127.0.0.1:40000/Captura%20de%20ecr%C3%A3%202023-02-26,%20%C3%A0s%2018.33.03.png
*   Trying 127.0.0.1:40000...
* Connected to 127.0.0.1 (127.0.0.1) port 40000 (#0)
> GET /Captura%20de%20ecr%C3%A3%202023-02-26,%20%C3%A0s%2018.33.03.png HTTP/1.1
> Host: 127.0.0.1:40000
> User-Agent: curl/7.86.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Access-Control-Allow-Origin: *
< Cache-Control: public, max-age=3600
< Content-Disposition: inline; filename="Captura de ecra 2023-02-26, as 18.33.03.png"; filename*=UTF-8''Captura%20de%20ecr%C3%A3%202023-02-26,%20%C3%A0s%2018.33.03.png

Fixed by supplying a dummy filename.
2023-02-28 14:48:54 +10:00
Abdo
f134a558e7 Add a button in the preferences to reset window sizes (#2405)
* Add a button in the preferences to reset window sizes

* Add post-reset pop-up so the user knows something's happened (dae)
2023-02-28 12:23:34 +10:00
Tobias Predel
3213cac695 Set deck to current deck when clicked on table row (#2383)
When a user clicks on the table row in the deck list (neither click on the deck
link nor on the options menu) while the shift key is pressed,
then set the deck in that table row as the current deck.

This gives the user some quick feedback and enables the user to easily create
subdecks (as it automatically fills the add deck dialog with the deck name of
the selected deck) and to create notes belonging to the selected deck.
2023-02-28 12:09:40 +10:00
Ren Tatsumoto
19dacf1d54 expose scroll_even_if_visible parameter to outside callers (#2404) 2023-02-28 12:05:04 +10:00
Fabricio Duarte
75f582e559 Fix open editors getting carried over to different notetypes (#2393)
* Fix open editors getting carried over to different notetypes

* Fix first field not getting automatically focused

* Fix collapsibles not transitioning in reduced motion mode

* Fix editor taking a longer time to start when reduced motion is enabled

If we don't transition, the editor actually takes considerably longer to create all the fields.

* Fix fields not collapsing when notetype is loaded
2023-02-27 16:49:48 +10:00
Matthias Metelka
af9feaeb04 Simplify NoteEditor by replacing Pane components with Collapsible (#2395)
* Remove Pane components and use Collapsible for TagEditor

* Update translations

* Give TagEditor border and focus outline

* Use ScrollArea from #2248 for fields

* Refactor ScrollArea

* Fix error caused by calling bridgeCommand when it's not available

* Make sure tag editor fills whole width of container

which is important for the CSV import page.

* Update NoteEditor.svelte

* Add back removed ftl strings

* Fix tests (dae)
2023-02-27 16:23:19 +10:00
Matthias Metelka
f11b3e5781 Swap impressed shadow for border effect on button hover (#2392) 2023-02-27 15:43:44 +10:00
Damien Elmes
de1baa90dd Bump version 2023-02-22 16:16:28 +10:00
Damien Elmes
70f2935d80 Ensure backend gets rebuilt after git changes 2023-02-22 15:58:39 +10:00
Damien Elmes
4328fa642e Anki version needs to be resolved at configure run time, not build time
Fixes incorrect info in wheels when version bumped
2023-02-22 15:58:38 +10:00
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