Commit graph

3246 commits

Author SHA1 Message Date
Damien Elmes
07017a4a8e Fix filter area not starting focused on Qt 6.6.1
https://forums.ankiweb.net/t/dialog-windows-no-longer-focus-inputbox/37880
2023-12-06 14:30:46 +10:00
Abdo
574f6a696d Fix TTS not working properly with auto advance (#2874)
* Fix TTS not working properly with auto advance

* Restore cb() call in error path (dae)
2023-12-06 11:45:33 +10:00
Damien Elmes
7675ddf80d Fix mpv idle notification not using main thread
Message arrived on a background non-Qt thread, and called run_in_background(),
which assumes it's running on the GUI thread. This resulted in single_shot()
failing to run in reviewer's on_av_player_did_end_playing on Linux/macOS.
2023-12-06 11:40:05 +10:00
Damien Elmes
c4edc5cc5e Handle invalid install timestamps in add-ons
https://forums.ankiweb.net/t/anki-23-12-beta/37771/57
2023-12-06 09:20:42 +10:00
Akash Reddy
9aa381775a Fix Mathjax can only be pasted once (#2869)
* Fix mathjax can be pasted only once

* Update about.py

* Update CONTRIBUTORS

* fix formatting
2023-12-05 10:01:25 +10:00
Abdo
1f4bd9b357 Clear editor's internal copied text on cut/copy (#2866) 2023-12-04 15:04:49 +10:00
Abdo
509b96e0a3 Fix auto advance state not being restored after focus change in some (#2860)
cases
2023-12-04 14:54:25 +10:00
Abdo
6e6dab3993 Prefer image pastes over HTML in the editor (#2856) 2023-12-01 15:23:07 +10:00
Abdo
b4f37b1aa5 Replace css_browser_selector with our own implementation (#2854)
* Replace css_browser_selector

* Add classes to root element instead of body

* Export addBrowserClasses() in reviewer_extras for mobile clients (dae)

* Avoid setting .mac on iOS devices (dae)
2023-11-30 10:57:33 +10:00
gustavosmendes1
68ac08c5df Added contributors and edit about (#2855) 2023-11-30 10:15:05 +10:00
Damien Elmes
9537646604 Rework error dialog
- Hide traceback
- Include full add-on info in 'copy debug info' button, like about
screen
- Link to troubleshooting page
- Use non-modal pop-up in the common case, to avoid potential conflicts
with other modals.

Closes #2830
2023-11-29 10:25:32 +10:00
Damien Elmes
1021502377 Add option to calculate all weights at once 2023-11-27 11:24:31 +10:00
Abdo
febaa524ab Load MathJax's text-chtml-full component in reviewer/previewer (#2836)
* Load MathJax's text-chtml-full in review screens

* Remove no longer needed MathJax extensions
2023-11-20 16:50:55 +10:00
Akash Reddy
a7e54e4050 Fix switching of add & history buttons when selecting IO notetype (#2833)
* Fix switching of add & history buttons when selecting IO notetype

* Update CONTRIBUTORS
2023-11-20 16:36:25 +10:00
Damien Elmes
60cfa254e8 Fix broken bundling on Windows 11
When Windows notices "install" in the filename it triggers a UAC elevation,
causing 'cargo run' to fail.
2023-11-20 12:01:34 +10:00
Hikaru Y
ee8b5ea171 Fix misalignment of IO masks in Qt5 when image is vertically long (#2829)
* Revert "Fix I/O not showing in Qt5"

This reverts commit 7249dd9811.

* Fix misalignment of IO masks in Qt5 when image is vertically long

Also, as in Qt6, constrain the IO image to fit in the viewport.
2023-11-16 10:30:54 +10:00
Damien Elmes
c1588356bd Automatically disable sandbox on Qt5 PyPi/packaged builds 2023-11-16 10:28:58 +10:00
Damien Elmes
a0f061d57a Add ability for pages created by add-ons to opt in to API 2023-11-14 15:55:09 +10:00
Damien Elmes
f346048e15 Bump Apple Silicon build to macOS 12+
Latest Xcode has broken macOS 11 on ARM, and I can't find a workaround

https://forums.ankiweb.net/t/can-t-open-anki-after-download/36938/14
2023-11-14 11:19:11 +10:00
Damien Elmes
d9f9103a36 Don't restrict answer key shortcuts
Qt seems to handle invalid input gracefully, and the previous approach
prevented things like umlauts or keys with modifiers.

https://forums.ankiweb.net/t/bug-cannot-set-answer-key-to-german-umlaut/37091
2023-11-13 16:09:32 +10:00
Damien Elmes
7249dd9811 Fix I/O not showing in Qt5
Images still gets stretched, because Qt5 doesn't support the aspect-ratio
CSS property, but it's better than nothing.

https://forums.ankiweb.net/t/possible-occulusion-issue-on-ver-23-10-and-the-solution/36894
2023-11-13 15:31:50 +10:00
RumovZ
cf28ec1437 Allow im-/exporting with or without deck configs (#2804)
* Allow im-/exporting with or without deck configs

Closes #2777.

* Enable webengine remote debugging in launch.json

* Reset deck limits and counts based on scheduling

Also:
- Fix `deck.common` not being reset.
- Apply all logic only depending on the source collection in the
gathering stage.
- Skip checking for scheduling and only act based on whether the call
wants scheduling. Preservation of filtered decks also depends on all
original decks being included.
- Fix check_ids() not covering revlog.

* Fix importing legacy filtered decks w/o scheduling

* Disable 'include deck options' by default, and fix tab order (dae)

* deck options > deck presets (dae)
2023-11-13 13:54:41 +10:00
Abdo
cb9d5218f7 Add auto-advance options to deck preset (#2765)
* Move stop-timer-on-answer strings to correct section

* Add auto-advance options to deck preset

* Implement answer actions

* Fix error when last card is answered before timeout

* Fix deserialization of answerAction

* Add answerAction to reserved key list

* Fix inverted boolean

* Add option to wait for audio to finish

* Add auto-advance toggle

* Add shortcut

* Disable auto-advance when main window state changes

* Start auto-advance timer after option is toggled

* Disable auto-advance when main window loses focus

* Use existing translations

* Add Answer Hard and Show Reminder
2023-11-13 10:41:51 +10:00
Kieran Black
b363445135 fix: refresh model list when legacy addon adds notetype (#2825)
* refresh model list when legacy addon adds notetype

When legacy addons add note types, they automatically add the note type to the collection models. When this was detected, the dialog box presenting the list of models was not being updated due to an early return in the code. This commit adds a list refresh along this path of execution to ensure the gui is updated with the newly added model.

* add trailing space to name in CONTRIBUTORS
2023-11-13 10:36:21 +10:00
Damien Elmes
02c476b54e More tweaks to API security
- Allow custom study methods in reviewer to prevent errors
- Ensure we 'fail closed' if referer header has been removed
- Ensure we ignore opaque POST requests from other origins

Thanks again to Daniel for the feedback.
2023-11-09 20:43:23 +10:00
Damien Elmes
58d69589ff Fix Anki closing before 'clock is off' message appears
Also fix it showing HTML code instead of formatted text
2023-11-08 12:01:31 +10:00
Damien Elmes
f822d9243d Prevent legacy pages apart from the editor from accessing our API
Thanks to Daniel for the suggestion.
2023-11-08 10:59:52 +10:00
Damien Elmes
a0c1bc723d Add ability to tag legacy pages with a context
Will allow us to identify which of our screens requests are coming in
through, until we can migrate them to separate entrypoints.
2023-11-08 10:59:15 +10:00
Damien Elmes
77b2fa5761 Ensure webpages in browser can't access local webserver
Thanks to Daniel for the report.
2023-11-08 10:59:15 +10:00
Damien Elmes
72471aeff6 Avoid shadowing import 2023-11-08 09:20:56 +10:00
Damien Elmes
c4a7cf663b Add confirmation for upload 2023-11-07 11:11:07 +10:00
Gustaf-C
5ff618b7ac Allow creation of empty filtered decks (#2788)
* Add new button to UI

* Add bool to allow creating empty filtered in back end

* Implement logic into front end for passing on bool

* Hide option on old decks

* Show option again if any settings are changed

* Revert "Show option again if any settings are changed"

This reverts commit 094acd9c65936823fa206594da5c1f3e4eb09248.

* Revert "Hide option on old decks"

This reverts commit d20a9a240b4fd85d080e8cc52d94318416ca753f.

* Update string

* Update ftl/core/decks.ftl

---------

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2023-11-05 12:23:14 +10:00
Damien Elmes
abd4e01ac9 Fix add-ons screen showing 'requires Anki >= 2.1.231000' 2023-11-05 11:16:09 +10:00
Damien Elmes
9841964e3c Fix 'creating backup' showing for longer than necessary 2023-11-03 22:18:30 +10:00
Damien Elmes
febde8136b Split sidebar review string
https://forums.ankiweb.net/t/im-trying-to-improve-the-translation-but-i-cant-find-it-in-one-place-please-help-me/35335/19
2023-11-03 21:25:10 +10:00
Damien Elmes
5c62092012 Split 'due' translation in deck browser 2023-11-02 21:15:02 +10:00
Damien Elmes
6e10b73e2a Fix syncserver failing to run in macOS packaged build
Closes #2794
2023-11-02 20:43:00 +10:00
Damien Elmes
3e159cd580 Jemalloc no longer seems to fail in cross-compile builds 2023-11-02 19:56:08 +10:00
Abdo
57850604a2 Fix error on 'Previous Card Info' when deleting a note (#2790) 2023-11-01 07:46:24 +10:00
Aristotelis
822dc933ea Move IO webview internals to editor (#2784) 2023-10-29 06:50:15 +10:00
Aristotelis
e1a0200fe3 Always set an AnkiWebViewKind (#2782) 2023-10-28 13:18:21 +10:00
Damien Elmes
ec28eb42f0 Add 'copy debug info' button to add-on startup screen 2023-10-28 11:59:54 +10:00
Damien Elmes
eb444ee821 Fix 'learn' showing twice in deck browser 2023-10-26 13:15:00 +10:00
Damien Elmes
e81c49032f Apply same ctrl+numpad enter fix that the add screen has
Likely regression in the switch to a main window
2023-10-26 11:57:37 +10:00
Damien Elmes
092b852236 Don't block collection when playing audio
https://forums.ankiweb.net/t/anki-23-10-release-candidate/35967/60
2023-10-26 11:46:02 +10:00
Damien Elmes
901f465bf4 Split translation of learn in the deck list
Closes #2708
2023-10-26 11:23:24 +10:00
Damien Elmes
f74e74b59a Tweaks to add-on startup failure screen / update checks
- Add a Check for Updates button to the screen
- Make the update list screen non-modal, so that other modal pop-ups
at startup don't leave the user stuck
- When manually checking for updates, update Anki's last check time
2023-10-26 11:23:24 +10:00
virinci
0c9f403ff1 Fix Linux install script CWD check (#2775) 2023-10-26 11:22:56 +10:00
Hikaru Y
0c2ba4ae92 Indicate current occlusion type in pop-up menu (#2760)
* Simplify handling of occlusion types in editor code

- Unify updateIONoteInEditMode(), setOcclusionFieldInner() and
setOcclusionField() into updateOcclusionsField()
- Don't use `includeInactive` property of Shape class in editor code
- Drop `isEditMode`

+
Update the occlusions field every time a mask or text is updated, not
only in editing mode but also in adding mode, so that IO cards can be
previewed correctly in the card layout screen

* Indicate current occlusion type in pop-up menu

https://forums.ankiweb.net/t/anki-23-10-beta-5-6/35677/46

* Fix a11y warnings in Toolbar.svelte

* Drop `occludeInactive` parameter from `MaskEditorAPI.getShapes()`
2023-10-23 09:12:56 +10:00
Aristotelis
641f18a12f Add APIs for IO mask editing (#2758)
* Add simple mask editor add-on API

* Signal completed mask editor image loading to Python

* Add API methods for querying mask editor state, fix formatting

* Use event forwarding to propagate image loaded event

Should fix mobile support by moving all bridgeCommand calls to `NoteEditor.svelte`

* Add shape classes to mask editor API

---------

Co-authored-by: Glutanimate <glutanimate@users.noreply.github.com>
2023-10-22 10:40:40 +10:00