RumovZ
2e923db6bd
Add checks for parsed templates
...
Combine existing check for unparsable templates with a check for unknown
field names and a check for front sides without any field replacement.
Updating the notetype's fields now mutates the parsed templates, so the
checks can run on the final templates.
2021-05-28 10:07:31 +02:00
RumovZ
c61587b1de
Use HashMap in identical template check
2021-05-27 12:45:17 +02:00
RumovZ
3dfa1de68b
Check for clozes when saving notetype
...
Error if:
- Cloze notetype lacks a cloze field on either template side.
- Non-cloze notetype has a cloze field on any template.
2021-05-27 12:01:05 +02:00
RumovZ
60131eab23
Check for identical templates before saving
2021-05-25 21:57:49 +02:00
RumovZ
fa19f590e8
Add details to TemplateSaveError
2021-05-25 21:01:03 +02:00
RumovZ
92aa5404c9
Preserve formatting of regex error
2021-05-16 21:07:35 +02:00
RumovZ
9b2cd52b97
Remove SearchErrorKind::Regex as it's never used
2021-05-16 21:07:03 +02:00
Damien Elmes
64ebc32b3d
tidy up Rust imports
...
rustfmt can do this automatically, but only when run with a nightly
toolchain, so it needs to be manually done for now - see rslib/rusfmt.toml
2021-04-18 18:38:54 +10:00
Damien Elmes
f666f15b63
use perform_op() for undo()
...
Instead of manually updating the UI after undoing, we just rely
on the same change notification infrastructure regular operations
use.
2021-04-03 14:38:49 +10:00
Damien Elmes
f55fe6e518
i18n error shown when attempting to rebuild normal deck
2021-04-01 22:55:10 +10:00
Damien Elmes
ac1b9fadde
merge the filtered deck errors into an enum
...
Fixes the wrong message being shown when trying to move cards to a
filtered deck
2021-04-01 22:30:00 +10:00
Damien Elmes
ba541076aa
convert card template error to tuple, and report notetype name in error
...
Older translations will note have the $notetype variable, but that is
not an error in Fluent - it would only cause problems if we tried to
use the new string on older Anki versions.
2021-04-01 17:59:33 +10:00
Damien Elmes
7a29d987c4
convert Json and Proto errors to tuple
2021-04-01 17:45:12 +10:00
Damien Elmes
55a6f10d24
tuple type for IoError
2021-04-01 17:40:35 +10:00
Damien Elmes
2b6c8b4296
tuple type for InvalidInput
2021-04-01 17:37:18 +10:00
Damien Elmes
a250464309
switch DbError to tuple type
2021-04-01 17:34:03 +10:00
Damien Elmes
1704f7fe80
drop dependency on failure crate
2021-04-01 17:21:13 +10:00
Damien Elmes
af37164fba
move sync/network errors into separate file
2021-04-01 17:02:54 +10:00
Damien Elmes
8363fcf2a8
move DB error into separate file; add InvalidRegex error
2021-04-01 16:28:23 +10:00
Damien Elmes
f14a631f68
split search errors into separate file
2021-04-01 16:18:28 +10:00
Damien Elmes
094e4ad461
crate::err -> crate::error
2021-04-01 16:07:13 +10:00