Commit Graph

289 Commits

Author SHA1 Message Date
Damien Elmes
f1a1b0891e make mark toggling undoable
- note.flush() behaves like before, as otherwise actions or add-ons
that perform bulk flushing would end up creating an undo entry for
each note
- added col.update_note() to opt in to the new behaviour
- tidy up the names of some related routines
2021-03-10 11:53:27 +10:00
Damien Elmes
bec77fd420 undo support for bulk tag add/remove 2021-03-10 11:47:53 +10:00
Damien Elmes
49a1970399 note deletion undo; refactoring
- transact() now automatically clears card queues unless an op
opts-out (and currently only AnswerCard does). This means there's no
risk of forgetting to clear the queues in an operation, or when undoing/
redoing
- CollectionOp->UndoableOp
- clear queues when redoing "answer card", instead of clearing redo
when clearing queues
2021-03-10 11:47:53 +10:00
Damien Elmes
40aff4447a undo support for note adding 2021-03-10 11:47:53 +10:00
Damien Elmes
105ce94dd4 undo unbury/unsuspend 2021-03-10 11:47:53 +10:00
Damien Elmes
1e7405296f
Merge pull request #1050 from BlueGreenMagick/choose-addon-to-update
Choose addon to update
2021-03-10 11:41:50 +10:00
RumovZ
08c09bcb0f Remove edit mode 2021-03-08 11:55:15 +01:00
RumovZ
f07890c178 Ask before removing tags from collection 2021-03-07 11:40:11 +01:00
RumovZ
6c4d6457fb Simplify multi deletion confirmation strings 2021-03-07 11:05:43 +01:00
RumovZ
4ab9e6caef Ask for confirmation when overwriting saved search 2021-03-04 17:22:03 +01:00
Damien Elmes
3ba08d1189 more undo strings 2021-03-04 11:52:20 +10:00
Damien Elmes
edaabee942 add undo.ftl 2021-03-04 11:03:09 +10:00
Damien Elmes
65acf70df4 handle case when .ftl file doesn't exist yet 2021-03-04 11:03:09 +10:00
RumovZ
65a2796a0e Enable group expanding/collapsing
Also, only show expand/collapse actions if they will have an effect.
2021-03-03 11:44:42 +01:00
bluegreenmagick
69006b5872 add dialog to choose addons to update 2021-03-03 10:34:43 +09:00
RumovZ
f4aeb0c097 Enable deleting multiple saved searches 2021-03-01 09:41:41 +01:00
Damien Elmes
fb7ee0355f turn the 'cards may be excluded' sentence into an action 2021-03-01 13:48:56 +10:00
Damien Elmes
32af54cd4d catch attempts to nest under a filtered deck; don't show traceback 2021-03-01 09:58:12 +10:00
Damien Elmes
5564fd9e13
Merge pull request #1040 from RumovZ/deck-name-err
Catch deck rename errors and localise warnings
2021-03-01 09:40:55 +10:00
RumovZ
88c69665f3 Add support for multi deck deletion in python 2021-02-26 19:52:34 +01:00
RumovZ
ef925a88d6 Add filtered deck error localisation on backend 2021-02-26 11:32:26 +01:00
RumovZ
f5981e94bf Add group search context action 2021-02-25 21:24:11 +01:00
RumovZ
8e43b29816 Localise RenameDeckError 2021-02-24 13:57:44 +01:00
RumovZ
ae88f7e593 Add clickable hint to dyndeckconf 2021-02-23 23:14:11 +01:00
Damien Elmes
13f5ee1ddc tweak update message
- Since we need to show this to new users until AnkiDroid is updated,
use a wording that doesn't seem so out of place to new users.
- Avoid mentioning syncing, since the user may not sync, and the
modSchema() call will allow the user to confirm anyway.
- Let the user know they can change their mind about AnkiDroid by
visiting the preferences.
2021-02-21 19:47:26 +10:00
Damien Elmes
5ae66af5d2 rework v2 scheduler upgrade; drop downgrade
- Rework V2 upgrade so that it no longer resets cards in learning,
or empties filtered decks.
- V1 users will receive a message at the top of the deck list
encouraging them to upgrade, and they can upgrade directly from that
screen.
- The setting in the preferences screen has been removed, so users
will need to use an older Anki version if they wish to switch back to
V1.
- Prevent V2 exports with scheduling from being importable into a V1
collection - the code was previously allowing this when it shouldn't
have been.
- New collections still default to v1 at the moment.

Also add helper to get map of decks and deck configs, as there were
a few places in the codebase where that was required.
2021-02-21 15:50:41 +10:00
Damien Elmes
397cff9194 split due into 'due today' and 'overdue' 2021-02-11 10:49:36 +10:00
Damien Elmes
9ce4b21935 add markdown flag for deck description
Needed so we can display consistently, and gradually transition over
2021-02-09 18:47:19 +10:00
Damien Elmes
71ac0fef32 fix wrong section heading in ftl 2021-02-09 16:38:19 +10:00
Damien Elmes
63b369b8a6 add 'untagged', and make clicking on 'tags' show all tagged cards 2021-02-09 12:50:35 +10:00
Damien Elmes
180efbc578 recent -> today
'Current deck' has moved, and by removing 'due tomorrow', we can drop
the 'today' suffix on the rest of the items.

The keys of the existing translations have not been changed, so
existing translations will not break, but will need to be manually
updated to make them shorter.
2021-02-09 09:50:59 +10:00
Damien Elmes
a8ddb65e1c add ability to force interval reset
- use trailing ! to force a reset
- use - instead of ..
- tweak i18n messages and error handling
2021-02-08 22:33:27 +10:00
Damien Elmes
dc10dbcfb2 remove some unused preference strings 2021-02-08 18:49:13 +10:00
Damien Elmes
704b5e581a Rework reschedule tool
The old rescheduling dialog's two options have been split into two
separate menu items, "Forget", and "Set Due Date"

For cards that are not review cards, "Set Due Date" behaves like the
old reschedule option, changing the cards into a review card, and
and setting both the interval and due date to the provided number of
days.

When "Set Due Date" is applied to a review card, it no longer resets
the card's interval. Instead, it looks at how much the provided number
of days will change the original interval, and adjusts the interval by
that amount, so that cards that are answered earlier receive a smaller
next interval, and cards that are answered after a longer delay receive
a bonus.

For example, imagine a card was answered on day 5, and given an interval
of 10 days, so it has a due date of day 15.

- if on day 10 the due date is changed to day 12 (today+2), the card
is being scheduled 3 days earlier than it was supposed to be, so the
interval will be adjusted to 7 days.
- and if on day 10 the due date is changed to day 20, the interval will
be changed from 10 days to 15 days.

There is no separate option to reset the interval of a review card, but
it can be accomplished by forgetting the card(s), and then setting the
desired due date.

Other notes:

- Added the action to the review screen as well.
- Set the shortcut to Ctrl+Shift+D, and changed the existing Delete
Tags shortcut to Ctrl+Alt+Shift+A.
2021-02-07 21:57:51 +10:00
Damien Elmes
c91a3784f6 update duplicate-string and copy 'set due date' in from AnkiMobile 2021-02-07 13:56:11 +10:00
Damien Elmes
b8d67cdad5 move remaining Filter button items into sidebar
- Closes #976
- Added helper to apply arbitrary colour to an icon.
- Fix #979 - low res icons in night mode.
- The icons and colours are not perfect - please feel free to send
through a PR if you can improve them.
- Convert colors dictionary into module consts, so we can
use code completion.
- Added "Edited Today" and "Due Tomorrow"
- Rename camelCase attribute to snake_case and tweak the wording
of some enum constants. We've already broken compatibility with the
major sidebar add-ons, so we may as well make these changes while we
can.
- Removed Filter button. Currently there is no exposed way to toggle
the Sidebar off - wonder if we still need it?
2021-02-05 18:58:22 +10:00
Damien Elmes
2e9c9af6bb minor wording tweak 2021-02-03 20:43:58 +10:00
RumovZ
16462941ab Remove actionCreateFilteredDeck2 and use modifier 2021-02-02 09:29:09 +01:00
RumovZ
8065e73ef8 Add cross links for second dyndeck filter 2021-02-01 19:10:05 +01:00
RumovZ
4d097b995d Add button in dynDeckConf to search in browser 2021-02-01 13:55:03 +01:00
RumovZ
0949cdc73e Rename "Filtered Deck from Current Filter" 2021-02-01 12:09:37 +01:00
RumovZ
011b562038 Add current-filter-to-filtered-deck action 2021-01-31 23:16:49 +01:00
Damien Elmes
cb805cf355 Merge branch 'more-backend-search' into main 2021-01-31 14:21:51 +10:00
RumovZ
9bfe8e3840 Remove search button and reword search bar hint 2021-01-30 19:23:40 +01:00
Damien Elmes
082b807c2e shorten search bar hint
There's a 'whole collection' link in the top left, so the latter part
is probably not required, and shortening this will bring it into line
with the sidebar placeholder. Open to suggestions on the wording,
just think it's probably best to keep it short.

Also remove unused string.
2021-01-30 11:37:39 +10:00
RumovZ
671c6a7b3e Rework search initialisation
- Remove _searchPrompt.
- Add placeholder prompt.
- Move search for current card from browser to caller. (Thus, support
  current card search even with opened browser.)
2021-01-29 21:07:42 +01:00
Damien Elmes
132bb5ff36 add expand/collapse children options 2021-01-29 22:54:00 +10:00
Damien Elmes
6ba5ff5a01 place each sidebar section under its own collapsible parent node
- Allows for group operations like "clear unused tags"
- Allows users to hide groups they're not interested in
2021-01-29 22:11:05 +10:00
Damien Elmes
4ac9ad1407 show actual error when graphData fails
The original reason for the catch-all message was users with bad
data such as decimal intervals, but those get automatically coerced
these days. The common case should now be invalid search strings, which
we can show verbatim.
2021-01-29 14:39:05 +10:00
Damien Elmes
025af52c9f add another example and tweak wording at top 2021-01-22 11:00:19 +10:00
RumovZ
9e8f74c3e2 Clarify comments in search.ftl 2021-01-22 00:11:09 +01:00
Damien Elmes
e56cb4bb08 minor ftl tidy-up before commit 2021-01-20 09:15:09 +10:00
Damien Elmes
d7516ae8d6 fix ftl check failing in non-utf8 locale 2021-01-19 16:28:13 +10:00
Damien Elmes
d273ebb756 more parsing error tweaks
The majority of the error checking can now be delegated to routines
like parse_f32(), parse_negative_i32() and so on, instead of creating
specific error messages for each type.
2021-01-19 15:50:26 +10:00
Damien Elmes
0b83efb63e simplify write_props() and associated translations
This is a work in progress; see associated PR discussion to follow.
2021-01-19 12:40:16 +10:00
Damien Elmes
318cc01c73
Merge pull request #900 from abdnh/tagtree
Hierarchical tags
2021-01-18 16:36:22 +10:00
Henrik Giesel
bdc6494c79 Generalize InvalidRatedEase error for rated and prop:rated 2021-01-17 23:55:05 +01:00
Damien Elmes
9686cd99ec search error tweaks
- use markdown instead of HTML, to make editing and translating easier
- use a shared prefix
- a few very minor wording tweaks
- we don't need to translate undocumented command errors
- share a string for positive number of days
- share a string for invalid property and state arguments, and avoid
listing them out

Related discussion: https://github.com/ankitects/anki/pull/922
2021-01-16 15:59:19 +10:00
RumovZ
cb4a103bb1 Merge branch 'master' into search-errors
Add error support for new resched node, update rated error.
2021-01-15 10:50:02 +01:00
RumovZ
105fa555f2 Fix HTML formatting for search errors 2021-01-15 09:43:36 +01:00
RumovZ
91d56a9b91 Add translatable search error strings 2021-01-15 09:10:19 +01:00
abdo
e018ea94b6 Merge branch 'master' of https://github.com/ankitects/anki into tagtree 2021-01-15 01:12:01 +03:00
RumovZ
8f754e1525 Add FailKinds for unopened/unclosed groups 2021-01-14 19:09:31 +01:00
RumovZ
0b73110f82 Make AnkiError::SearchError work with ParseError
Use mock ftl strings for now.
2021-01-14 11:14:55 +01:00
Damien Elmes
aad37c94fd update translations 2021-01-14 10:16:22 +10:00
abdo
b276ce3dd5 Hierarchical tags 2021-01-09 17:10:13 +03:00
Damien Elmes
ddee091d9d remove spaces around '/' 2021-01-07 19:40:01 +10:00
Henrik Giesel
ee94c7eb93 Add label for SeparateInactiveCheckbox in ftl file 2021-01-05 19:13:57 +01:00
Damien Elmes
86b90c4813
Merge pull request #886 from BlueGreenMagick/browser-sidebar-rename-tag
add rename_tag to browser sidebar contextmenu
2021-01-04 13:43:04 +10:00
Damien Elmes
da5c565334 fix ftl formatting 2021-01-04 13:27:35 +10:00
Damien Elmes
ffd59a03c0 show what's wrong when bad formatting found in ftl 2021-01-04 13:27:12 +10:00
Damien Elmes
bef1fabd74 catch references to missing terms in ftl check
https://github.com/ankitects/anki/pull/889

- We can't use compare_locales's getChecker(), as it seems to
be focused on checking translations rather than the original
templates.
- Also fix return code not being passed on in check_files()
- Temporarily pin pip-tools, as its output format has changed
2021-01-04 13:19:17 +10:00
abdo
7bd3137425 Escape literal curly braces in Fluent 2021-01-04 00:31:58 +03:00
BlueGreenMagick
46346d01a0 add rename_tag to browser sidebar contextmenu 2021-01-03 16:36:54 +09:00
Arthur Milchior
89ffbe0fbb Reject field name with : { or }
More than {{ is acceptable to start a tag, which means that `{{{Foo}}` won't be interpreted as "the content of `Foo`"
and should be rejected. For the sake of clarity and parsing, I suspect that those symbol should be rejected elsewhere
too.

Similary `{{Foo}}}` won't be interpreted as "Show the content of field `Foo}`" even if this field exists, so it's better
to reject `}`. It's clearly necessary to reject "}}" inside the field name, rejecting "}" seems easier to explain and
avoid future unexpected problem if the templates change.

The ":" are used to separate filters, and rejecting it in field name would ensure that there is no ambiguity.
2020-12-28 07:33:26 +01:00
Arthur Milchior
af6cb6612e Rejects field names starting with #, ^ and / 2020-12-28 06:23:49 +01:00
Damien Elmes
5dd0eaf0a2 update translations; use http_archive 2020-12-23 21:28:07 +10:00
Damien Elmes
0a633160c5 add video driver enum; allow setting angle+software on mac in prefs 2020-12-22 13:01:06 +10:00
Damien Elmes
9d17d43124 avoid using literal 1 in English translations
It confuses translators:

https://forums.ankiweb.net/t/bug-in-review-intervals-for-some-languages-in-number-of-cards/5744/8
2020-12-18 10:14:19 +10:00
Damien Elmes
a9614a3971 remove format separator from recording string 2020-12-16 19:44:47 +10:00
Damien Elmes
4adf6c62e0 tweak graphs search error msg 2020-12-15 20:40:58 +10:00
Damien Elmes
0c08ff5317
Merge pull request #835 from abdnh/init-lang
Set up default language before loading profile
2020-11-22 16:25:44 +10:00
Damien Elmes
8056ff0014 fluent-syntax depends on six 2020-11-22 16:20:42 +10:00
Damien Elmes
d85d0b88a1
Merge branch 'master' into init-lang 2020-11-22 16:10:49 +10:00
Damien Elmes
1e8e4ee603 move other i18n scripts to ftl/ 2020-11-22 15:41:14 +10:00
Damien Elmes
52617511b0 automatically format/check ftl files 2020-11-22 15:30:59 +10:00
Damien Elmes
0b848eae56 update remaining python format strings to Fluent 2020-11-22 14:57:53 +10:00
abdo
7d7745fbb5 Set up default language before loading profile
We can make more strings translatable this way.
2020-11-21 05:29:23 +03:00
Damien Elmes
fcb3283a9d move ftl into top level ftl/ folder; make it source of truth for aqt
This avoids the need to modify the external repo before new strings
can be used in aqt.
2020-11-18 16:20:58 +10:00