Commit Graph

2894 Commits

Author SHA1 Message Date
Akash Reddy
9fd25a87ec
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
Hikaru Y
8de5cf9690
Fix misalignment of IO masks in Qt5 when image is vertically long (#2829)
* Revert "Fix I/O not showing in Qt5"

This reverts commit c478689e5a.

* 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
0754a50b5b Automatically disable sandbox on Qt5 PyPi/packaged builds 2023-11-16 10:28:58 +10:00
Damien Elmes
07909a54e2 Add ability for pages created by add-ons to opt in to API 2023-11-14 15:55:09 +10:00
Damien Elmes
f2fba6f9e8 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
c478689e5a 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
f200d6248e
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
ae7b14bf40
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
46890fbbaa
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
f73eb01047 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
2241d2fd9d 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
8ec97ddbde 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
780ebac3aa 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
454ca6ce2c 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
6ebe726670 Avoid shadowing import 2023-11-08 09:20:56 +10:00
Damien Elmes
0b8b168df1 Add confirmation for upload 2023-11-07 11:11:07 +10:00
Gustaf-C
e071fb471b
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
e7436a2b23 Fix add-ons screen showing 'requires Anki >= 2.1.231000' 2023-11-05 11:16:09 +10:00
Damien Elmes
ab3a37ff71 Fix 'creating backup' showing for longer than necessary 2023-11-03 22:18:30 +10:00
Damien Elmes
726a59118f 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
ea84ca9300 Split 'due' translation in deck browser 2023-11-02 21:15:02 +10:00
Damien Elmes
f5fb0fd9e6 Fix syncserver failing to run in macOS packaged build
Closes #2794
2023-11-02 20:43:00 +10:00
Abdo
252b4e7f00
Fix error on 'Previous Card Info' when deleting a note (#2790) 2023-11-01 07:46:24 +10:00
Aristotelis
fe41b4a136
Move IO webview internals to editor (#2784) 2023-10-29 06:50:15 +10:00
Aristotelis
20813eeb32
Always set an AnkiWebViewKind (#2782) 2023-10-28 13:18:21 +10:00
Damien Elmes
5a07ef06e4 Add 'copy debug info' button to add-on startup screen 2023-10-28 11:59:54 +10:00
Damien Elmes
96aab939aa Fix 'learn' showing twice in deck browser 2023-10-26 13:15:00 +10:00
Damien Elmes
7428ecadc3 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
a7b8cb87de 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
bbe9dc5186 Split translation of learn in the deck list
Closes #2708
2023-10-26 11:23:24 +10:00
Damien Elmes
865296254a 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
Hikaru Y
a53806e24a
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
56f7d54900
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
kelciour
1954a28bcb
Change export notes' parent window in card browser (#2761) 2023-10-22 10:23:58 +10:00
Abdo
0ce9b3f0a1
Refresh reviewer as the day rolls over (#2756) 2023-10-21 12:18:01 +10:00
Damien Elmes
1b8f5496f9 Don't automatically disable add-ons
d7a0bc0d42 (commitcomment-130467314)

Also, make the pop-up non-modal so it can be left on screen as the user
navigates to the add-on screen.
2023-10-20 11:12:56 +10:00
Damien Elmes
d7a0bc0d42 Display all startup errors at once, and automatically disable add-ons
https://forums.ankiweb.net/t/anki-23-10-beta-5/35677/48
2023-10-19 13:40:39 +10:00
Abdo
b23f17df27
Drop support for checkpoints (#2742)
* Drop support for checkpoints

* Deprecate .flush()

* Remove .begin/.commit

* Remove rollback() and deprecate save/autosave/reset()

There's no need to commit anymore, as the Rust code is handling
transactions for us.

* Add safer transact() method

This will ensure add-on authors can't accidentally leave a transaction
open, leading to data loss.

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2023-10-17 12:43:34 +10:00
Abdo
01738757ef
Prevent media syncing from blocking collection tasks (#2740) 2023-10-17 09:47:50 +10:00
Abdo
bd55149846
Reduce shaking of bottom bar (#2734) 2023-10-15 10:06:28 +10:00
Damien Elmes
9f0dd4a63f Fix startup failure in macOS bundle
Closes #2731
2023-10-14 13:49:33 +10:00
Damien Elmes
76e6da6652 Switch Qt5 shims from opt-out to opt-in
If you have an add-on that hasn't been updated yet, please contact
the add-on author. You can temporarily restore functionality by defining
an ENABLE_QT5_COMPAT=1 env var.
2023-10-14 11:46:46 +10:00
Abdo
5cde4b6941
Remove v1/v2 support from the backend (#2727)
* Remove v1/v2 support from deck list

* Remove v1/v2 support from most routines and show error

* Remove scheduler_version from preferences

* Fix formatting

* Remove v1/v2 conditionals from Python code

* Fix legacy importer

* Remove legacy hooks

* Add missing scheduler checks

* Remove V2 logic from deck options screen

* Remove the review_did_undo hook

* Restore ability to open old options with shift (dae)
2023-10-14 10:50:59 +10:00
Abdo
115f2a425e
Turn edit window into a QMainWindow (#2732)
* Turn edit window into a QMainWindow

* Ensure dialog is garbage collected (dae)
2023-10-14 10:29:57 +10:00
Abdo
6c2205663e
Fix previewer geometry not being restored sometimes (#2728) 2023-10-13 08:50:40 +10:00
Aristotelis
7ce1c4439a
Propagate editor UI state transitions to add-ons (#2711)
* Propagate editor UI state transitions to add-ons

* Also set initial Python state to EditorState.INITIAL

---------

Co-authored-by: Glutanimate <glutanimate@users.noreply.github.com>
2023-10-13 08:47:50 +10:00
chandraiyengar
b35a11ffd6
Add profile name in profile deletion confirmation message (#2722)
* Add profile name in profile deletion confirmation message

* Update contributors

* leave old translation and add new one
2023-10-12 13:34:52 +10:00
virinci
d261d1e467
Fix ModuleNotFoundError: No module named 'distutils' (#2723) 2023-10-11 14:12:18 +10:00
RumovZ
23f29a6ecc
Invalid sorting (#2709)
* Rollback if toggling state fails

Previously, if the search triggered by a state toggle failed, the switch
and the model would move to the new state, while the table would remain
in the previous state.

* Fix reversed sort orders of FSRS columns

* Add sep. default sort orders for notes and cards

* Add test for consistent default sort orders

* Add launch config for debugging in VSC

* Extend launch config for macOS and Linux
2023-10-07 06:36:15 +00:00
Damien Elmes
259ed9c34d Show tooltip on sync completion
Closes #2695
2023-10-03 12:57:39 +10:00