Commit graph

1816 commits

Author SHA1 Message Date
Benjamin K
61fd5688c0 Clean up imports 2021-03-04 19:55:35 +01:00
Benjamin K
48da1bda1d The old delimiter is now kept, when cancel button is clicked 2021-03-04 19:39:43 +01:00
RumovZ
572bf12d9d Make clickable dyndeck labels fixed in size 2021-03-01 11:26:52 +01:00
Damien Elmes
45e1aacaf1 monospace font in html editor
https://forums.ankiweb.net/t/change-default-font-of-html-edit-mode-to-a-monospaced-font/7833
2021-03-01 10:16:12 +10:00
Damien Elmes
24ba4e3a29 catch attempts to nest under a filtered deck; don't show traceback 2021-03-01 09:58:12 +10:00
Damien Elmes
5045517f8a 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
c4a2a212ec Catch DeckIsFilteredError directly on frontend 2021-02-26 11:32:40 +01:00
Damien Elmes
0377783a59 remove left-click on saved searches
Multiple users have thought it was a bug rather than an intentional
feature, and it breaks double-clicking:

https://forums.ankiweb.net/t/anki-2-1-41-beta/7305/51
2021-02-26 18:48:32 +10:00
Damien Elmes
5e946fad08 fix browser appearance defaults
https://forums.ankiweb.net/t/small-bug-in-the-browser-appearance-window/7806
2021-02-26 18:46:09 +10:00
Damien Elmes
2ffaf9499d Merge pull request #1039 from RumovZ/dyndeck-hint
Clickable hint in dyndeck dialogue for unmovable cards
2021-02-26 18:02:51 +10:00
bluegreenmagick
5ef9401686 StudyDeck without add button 2021-02-25 07:34:01 +09:00
RumovZ
b8f828a465 Fix #1024 – catch deck rename errors 2021-02-24 13:59:38 +01:00
RumovZ
5e7b594c71 Localise RenameDeckError 2021-02-24 13:57:44 +01:00
RumovZ
1686a065f8 Fix type hints in dyndeckconf 2021-02-24 11:24:27 +01:00
RumovZ
6ae03c3aa9 Refactor dyndeckconf/on_hint_button 2021-02-24 11:14:33 +01:00
RumovZ
6eca669cb0 Give dyndeck hint unique styling 2021-02-23 23:34:05 +01:00
RumovZ
c0dfce3908 Add clickable hint to dyndeckconf 2021-02-23 23:14:11 +01:00
RumovZ
bb58060c91 Add direct col reference to dyndeckconf 2021-02-23 22:31:04 +01:00
Henrik Giesel
e2bda7273e Fix scrollbar issue in anki-editable component in two ways
- using :host-context(.nightMode) allows for applying the nightmode
  scroll bar inside the component
- apply max-width: 100% to all element within editable, not just images
2021-02-23 15:52:20 +01:00
Damien Elmes
abd9d42869 Merge pull request #1034 from abdnh/clayout-cloze-shortcuts
Shortcuts to preview clozes in card layout screen
2021-02-22 10:07:16 +10:00
abdo
f137c21d02 Shortcuts to preview clozes in card layout screen
Assign Alt+{number} to select cloze cards.
2021-02-21 14:46:53 +03:00
Damien Elmes
c2c5174bd2 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
125c2b232a 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
bluegreenmagick
8c5ffa5c19 change _on_click_current to _on_click_index
fix bug where clicking on a blank space below sidebar item
would still trigger currentIndex item's click event
2021-02-20 22:58:02 +09:00
Damien Elmes
be823c39f0 tweak getFile() arguments in editor to be more readable 2021-02-19 10:18:40 +10:00
Damien Elmes
17396dc89b disable card shifting in reposition by default
https://forums.ankiweb.net/t/uncheck-shift-position-of-existing-cards-by-default/7550
2021-02-19 10:09:01 +10:00
Damien Elmes
0b2ee8dcff use add-on id if name is blank
https://forums.ankiweb.net/t/support-for-rtl-layout-in-ankiweb-add-on-page/7522
2021-02-16 11:12:05 +10:00
Henrik Giesel
c2410ded9c Remove unused imports 2021-02-12 02:16:05 +01:00
Henrik Giesel
72253e129f Allow for passing in custom note type and template 2021-02-12 02:12:03 +01:00
Henrik Giesel
6e22b8b145 Allow for passing in custom note types for rendering ephemeral cards 2021-02-12 01:53:03 +01:00
Damien Elmes
0907b77fef Revert "Use new note.ephemeral_card method in clayout"
This partially reverts commit 4ca24f1d84.
2021-02-12 10:05:46 +10:00
Damien Elmes
28a9ba473d tweak search wording and tidy up API
- SearchTerm -> SearchNode
- Operator -> Joiner; share between messages
- build_search_string() supports specifying AND/OR as a convenience
- group_searches() makes it easier to negate
2021-02-11 19:57:19 +10:00
Damien Elmes
6e28b096f8 more search bikeshedding
While implementing the overdue search, I realised it would be nice to
be able to construct a search string with OR and NOT searches without
having to construct each part individually with build_search_string().

Changes:

- Extends SearchTerm to support a text search, which will be parsed
by the backend. This allows us to do things like wrap text in a group
or NOT node.
- Because SearchTerm->Node conversion can now fail with a parsing error,
it's switched over to TryFrom
- Switch concatenate_searches and replace_search_term to use SearchTerms,
so that they too don't require separate string building steps.
- Remove the unused normalize_search()
- Remove negate_search, as this is now an operation on a Node, and
users can wrap their search in SearchTerm(negated=...)
- Remove the match_any and negate args from build_search_string

Having done all this work, I've just realised that perhaps the original
JSON idea was more feasible than I first thought - if we wrote it out
to a string and re-parsed it, we would be able to leverage the existing
checks that occur at parsing stage.
2021-02-11 17:11:17 +10:00
Damien Elmes
5ad2cd56d1 switch some existing code to use SearchTerm(negated=...) 2021-02-11 10:55:02 +10:00
Damien Elmes
fe503ba009 split due into 'due today' and 'overdue' 2021-02-11 10:49:36 +10:00
Damien Elmes
e871ec68b5 Revert "experiment with using right click for AND/OR/NOT"
This reverts commit cbf0cdd30e and
manually comments out the setSelectionMode() call.

Switching back to the old behaviour until issues can be worked through.
https://forums.ankiweb.net/t/anki-2-1-41-beta/7305/24
2021-02-11 10:14:26 +10:00
Damien Elmes
9146c79f9e Revert "add escape hatch for new clicking behaviour, in case it causes problems"
This reverts commit e618756998.
2021-02-11 10:10:45 +10:00
Damien Elmes
42a44875ab convert qt strings to f-strings with flynt
Also revealed an incorrect type def in editor.py that mypy wasn't
noticing before :-(
2021-02-11 10:09:06 +10:00
Damien Elmes
bf7528d90a minor code cleanups with pyupgrade
- pyupgrade --py38-plus --keep-runtime-typing --keep-percent-format
- third-party mpv and winpaths excluded
2021-02-11 09:43:40 +10:00
Damien Elmes
e64e807782 catch TTS runtime error 2021-02-10 16:30:51 +10:00
Damien Elmes
e618756998 add escape hatch for new clicking behaviour, in case it causes problems 2021-02-09 19:29:59 +10:00
Damien Elmes
895e274faf 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
83e2538f8e tweak sidebar appearance
- draw a border between sidebar and main area
- tweak padding

Testing is a pain, because you need to check day mode on the
three platforms, and night mode as well. If you can do it better, PRs
are welcome :-)
2021-02-09 16:23:44 +10:00
Damien Elmes
8a585b47ae add 'untagged', and make clicking on 'tags' show all tagged cards 2021-02-09 12:50:35 +10:00
Damien Elmes
cbf0cdd30e experiment with using right click for AND/OR/NOT
This frees up Ctrl/Shift+left click to behave like in a typical GUI
app. On a Mac users can either two finger click, or Command+click in
conjunction with one of the other modifiers.

https://github.com/ankitects/anki/issues/1011
2021-02-09 11:39:47 +10:00
Damien Elmes
eb42d8d07b move update_search into sidebar.py; fix setFilter()
No idea why neither mypy nor pylint are not noticing
"set_filter_then_search" does not exist. Python tooling. :-(
2021-02-09 10:50:39 +10:00
Damien Elmes
ba99d42a0a Partially revert "don't select contiguously with shift+click"
I thought this could work, but users (including myself!) are used to
being able to shift+click to select a region, and this behaviour is
surprising. We're also doing potentially expensive searches for each
extra selected item. I think we may need to switch this behaviour to
the right mouse button instead.

This partially reverts commit 679f57cfde.
2021-02-09 10:37:21 +10:00
Damien Elmes
fbc5bb6d70 move flags above card state; change stage label for consistency 2021-02-09 09:54:46 +10:00
Damien Elmes
b44cfcda82 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
55dbd54e0e fix rename/delete on current deck 2021-02-09 09:38:37 +10:00