Commit graph

9468 commits

Author SHA1 Message Date
RumovZ
71e6292f8d Maybe upgrade scheduler of apkg 2022-04-11 09:10:08 +02:00
RumovZ
251bfc4920 Factor out media importing 2022-04-11 08:44:18 +02:00
RumovZ
fe878dcdc8 Factor out note importing 2022-04-11 08:28:10 +02:00
RumovZ
a7278836d4 Factor out card importing
Also handle missing parents .
2022-04-10 16:07:35 +02:00
RumovZ
a402879e72 Refactor card and revlog importing 2022-04-10 11:03:46 +02:00
RumovZ
8348240f80 Factor out card importing 2022-04-10 10:36:42 +02:00
RumovZ
e1899152be Fix importing cards/revlog
Card ids are manually uniquified.
2022-04-10 09:22:41 +02:00
Damien Elmes
51a0641bba Sort field change without field change should mark schema modified
Closes #1789
2022-04-10 08:52:55 +10:00
RumovZ
126a92c239 Handle card due dates and original due/did 2022-04-09 23:42:05 +02:00
RumovZ
a528106af0 Keep source ids of imported deck configs (or skip) 2022-04-09 15:52:23 +02:00
RumovZ
7798b78c7d Wrap apkg import in transaction 2022-04-09 15:35:16 +02:00
RumovZ
1ba5444d7d Make adding notetype with id undoable 2022-04-09 12:31:23 +02:00
RumovZ
2a15ba5404 Try to keep source ids of imported notes 2022-04-09 11:40:36 +02:00
RumovZ
5a76d2211a Keep source ids of imported revlog (or skip) 2022-04-09 10:17:28 +02:00
RumovZ
a0604a2e51 Keep source id of imported cards (or skip) 2022-04-09 09:49:36 +02:00
Damien Elmes
0b2a226dc8 Add mock stdout/stderr for console=False case on Windows
PyInstaller provided a NulWriter when running in GUI mode, but stdout/
stderr now default to None with PyOxidizer.

Fixes #1786
2022-04-09 16:48:32 +10:00
Abdo
a99253b990
Allow passing args to anki-console.bat (#1785) 2022-04-09 14:40:26 +10:00
roxgib
77d14ddf1e
Add minimumContentsLength property to templatesBox (#1781)
Addresses #1777 by adding the `minimumContentsLength` property to the comboBox, which causes the size policy to not require expanding beyond that amount while still expanding if the user stretches the window manually.

Note that users who were previously experiencing large window widths due to the previous behaviour might see the same size again due the geometry being restored.
2022-04-09 13:55:03 +10:00
Aristotelis
8100e81789
Fix a number of bugs with add-on conflict resolution (#1780)
* Always enable manually installed add-ons

Ensures that manually installed add-ons are enabled after the installation, even if previously disabled.

Prevents scenarios where users could end up with no active add-on build (e.g. when switching between stable add-on builds distributed via AnkiWeb and betas distributed via GitHub).

* Improve type annotations

* Also enable disabled AnkiWeb add-ons upon interactive installation

Applies to add-ons that users actively install via their AnkiWeb ID. Updates are exempt, preserving whatever status add-ons were in.

* Prevent disabled add-ons from triggering conflicts

* Fix download_addons() not passing on force_enable argument (dae)
2022-04-09 13:51:59 +10:00
Henrik Giesel
f3f5a42218
Speed up editor by lazily loading CodeMirror - Second try (#1776)
* Revert "Revert "Speed up editor by lazily loading CodeMirror (#1766)""

This reverts commit b0a2884f19.

* Pass in options via action update + Make access to editor optional
2022-04-09 13:25:54 +10:00
RumovZ
4a6767b1fc
Implicitly group when joining searches (#1759)
* Implicitly group when joining searches

* Allow joining search types directly

* Test search joining

* Add comment for future selves (dae)

* Add one more assert that shows nested grouping (dae)

* Join user searches without grouping again

* Flatten a few clauses in custom study (dae)
2022-04-09 13:22:27 +10:00
Abdo
964f0a5763
Add relative overdueness to review order (#1757)
* Add relative overdueness to review order

* Add test for relative overdue
2022-04-09 13:20:09 +10:00
Damien Elmes
a7ad6aebba Update translations 2022-04-09 13:08:35 +10:00
Damien Elmes
0fe2b6f699 Garbage-collect unused FTL strings
Two strings related to scheduler upgrade have been manually excluded,
as we may be able to reuse them for a future V3 update.
2022-04-09 12:39:50 +10:00
Damien Elmes
b288470e6b Don't store used FTL keys in git
In hindsight, we don't really need to keep the lists stored in git, as
they're easy enough to generate, and GC runs are infrequent.
2022-04-09 12:38:54 +10:00
Damien Elmes
ed38ebd49c Bump version 2022-04-09 11:43:27 +10:00
RumovZ
726438d1c5 Add roundtrip test for apkg (stub) 2022-04-08 22:09:45 +02:00
RumovZ
fef4a6d6fe Test new functions in text.rs 2022-04-08 22:06:54 +02:00
RumovZ
44d727a693 Fix search_cards_of_notes_into_table() 2022-04-08 19:15:20 +02:00
RumovZ
d6134748f2 Fix signature of import_apkg() 2022-04-08 18:57:01 +02:00
RumovZ
468c0286f9 Use dyn instead of generic for media_fn
Otherwise, would have to pass None with type annotation in the default
case.
2022-04-08 18:46:40 +02:00
RumovZ
08791e24fc Add import_cards(), import_revlog() 2022-04-08 18:12:37 +02:00
RumovZ
ffdd8b741e Add import_deck_configs() 2022-04-08 10:52:12 +02:00
RumovZ
7520afd9c5 decks_configs → deck_configs 2022-04-08 10:41:33 +02:00
RumovZ
5cf1705784 Add import_decks() 2022-04-08 10:34:49 +02:00
RumovZ
48bc6627b1 Note id, not guid of conflicting notes 2022-04-07 21:08:17 +02:00
RumovZ
94a6cdd6ed Add notes immediately instaed of preparing 2022-04-07 20:49:42 +02:00
RumovZ
b9c19273fc Move target_col into Context 2022-04-07 19:04:24 +02:00
RumovZ
9527322231 Add notetypes immediately instaed of preparing 2022-04-07 18:58:11 +02:00
RumovZ
5bfd47e415 Add trait to keep down cow boilerplate 2022-04-07 16:01:01 +02:00
RumovZ
cd4865dd18 Handle encoding in replace_media_refs() 2022-04-07 12:51:26 +02:00
RumovZ
7583a7e6b3 Prepare media based on checksums
- Ensure all existing media files are hashed.
- Hash incoming files during preparation to detect conflicts.
- Uniquify names of conflicting files with hash (not notetype id).
- Mark media files as used while importing notes.
- Finally copy used media.
2022-04-07 12:45:02 +02:00
RumovZ
a0085e7fd4 Add SafeMediaEntry for deserialized MediaEntries 2022-04-06 23:21:32 +02:00
RumovZ
efde7c7acc Refactor import-export/package
- Move media and meta code into appropriate modules.
- Normalize/check for normalization when deserializing media entries.
2022-04-06 18:02:02 +02:00
RumovZ
80dc3ae99e Fix due dates in days for apkg export 2022-04-06 12:31:29 +02:00
Damien Elmes
26d40c3a8e Update translations 2022-04-06 11:51:49 +10:00
Damien Elmes
f2bffaa185 Tweaks to video driver handling
- Use a separate `gldriver6` file for configuring Qt6 so we don't
pick up old settings, or cause problems when switching back and forth.
- Default to OpenGL/auto instead of software, as that was what we
were using throughout the beta period.
- Try to detect driver failure on startup. Untested.
- Hide the selector in the preferences again, as if Anki is unable
to automatically switch drivers, the user could change the setting
and then not be able to get back into Anki.
2022-04-06 11:35:49 +10:00
Damien Elmes
b0a2884f19 Revert "Speed up editor by lazily loading CodeMirror (#1766)"
This reverts commit 0db921dd39.

This caused a regression that needs looking into:
https://github.com/ankitects/anki/issues/1775
2022-04-06 11:08:32 +10:00
RumovZ
6836da07ec Start on apkg importing on backend 2022-04-05 18:15:51 +02:00
Damien Elmes
c96ef8cd0a Update translations 2022-04-05 11:23:07 +10:00