Commit graph

3220 commits

Author SHA1 Message Date
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
kelciour
3167505916 Change export notes' parent window in card browser (#2761) 2023-10-22 10:23:58 +10:00
kelciour
fc06368f53 Make it possible to silent uninstall with WinGet (#2757) 2023-10-21 12:23:12 +10:00
Abdo
2b6cb0f7f4 Refresh reviewer as the day rolls over (#2756) 2023-10-21 12:18:01 +10:00
Damien Elmes
b54138b3ec Don't automatically disable add-ons
773bceab4d (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
773bceab4d 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
ed3ec0386e 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
e76c67b26c Prevent media syncing from blocking collection tasks (#2740) 2023-10-17 09:47:50 +10:00
Abdo
8b5204ef88 Reduce shaking of bottom bar (#2734) 2023-10-15 10:06:28 +10:00
Damien Elmes
79ef44987f Fix startup failure in macOS bundle
Closes #2731
2023-10-14 13:49:33 +10:00
Damien Elmes
9819a71f40 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
10966394fd 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
c3150b2b35 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
bb27aa3ce3 Fix previewer geometry not being restored sometimes (#2728) 2023-10-13 08:50:40 +10:00
Aristotelis
534b5f10c1 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
0f9fdd4dae 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
8d0d28e3a2 Fix ModuleNotFoundError: No module named 'distutils' (#2723) 2023-10-11 14:12:18 +10:00
RumovZ
fd94ad49a0 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
518dc1f303 Improve Python Protobuf speed
upb was being included in the bundle, but not found at run time due
to src files being embedded in the binary.
2023-10-04 13:36:47 +10:00
Damien Elmes
0e50cef207 Show tooltip on sync completion
Closes #2695
2023-10-03 12:57:39 +10:00
Damien Elmes
1f93e0111f Fix TypeError when deck list or overview refreshes during optimal retention
Caused by legacy code blocking the main thread.

https://forums.ankiweb.net/t/anki-23-10-beta/34912/79
2023-09-30 16:10:23 +10:00
Abdo
fb9c814e6c Allow creating an image occlusion from the clipboard (#2689)
* Allow creating an image occlusion from the clipboard

* Refactor pasted image name construction into methods

* Reduce button's top padding

* Fix capitalization

* Fix quality parameter of pasted image

* Fix lint errors

* setup_mask_editor_for_file -> setup_mask_editor

* Select -> Paste

* Extract image reading logic

* Fix inlinedImageToFilename
2023-09-29 15:51:44 +10:00
Abdo
97bd06dc49 Implement "stop timer on answer" as a preset option (#2686)
* Implement "stop timer on answer" as a preset option

* Hide timer setting on AnkiMobile (dae)
2023-09-27 16:10:14 +10:00
Damien Elmes
dc6aeafeff Strip out v1/v2 code 2023-09-24 14:27:40 +10:00
Damien Elmes
921416a263 Enable new exporter by default 2023-09-24 13:10:16 +10:00
Abdo
6f0d76d647 Support Qt.TextFormat.MarkdownText in aqt.utils (#2675) 2023-09-23 14:04:25 +10:00
Abdo
a3c7a07a96 Add an option to stop the timer on answer (#2673)
* Add an option to stop the timer on answer

* Fix tab order
2023-09-23 14:01:03 +10:00