Commit graph

6728 commits

Author SHA1 Message Date
Arthur Milchior
574a513fe6 Return meaningful message if a field is empty after normalizing
This correct the probably rare bug as follow:

I got a note type with a field whose name is "\".

When I made any change to this note type, even unrelated, I get a message stating that there is an empty field. This is
strange because I can see it to be false. Investigating show that "\" is normalized to empty field. This ensure that
it's shown
2021-03-14 02:10:32 +01:00
Damien Elmes
455a93cc27 ensure fields normalized before checksumming
https://forums.ankiweb.net/t/python-checksum-rust-checksum/8195
2021-03-13 10:23:32 +10:00
Damien Elmes
b5a913c1cf Merge pull request #1067 from RumovZ/regex-err
Fix regex error formatting and search error escaping
2021-03-13 10:16:10 +10:00
RumovZ
9bbe584522 Fix markdown escaping in search errors 2021-03-12 20:32:38 +01:00
RumovZ
456a3b214a Fix formatting of invalid regex error
Preserve whitespace, special characters and use monospace font.
2021-03-12 20:31:23 +01:00
Damien Elmes
ae6cf81d69 add indexes to graves table to speed up undo 2021-03-12 18:59:24 +10:00
Damien Elmes
f25b95b312 avoid hanging UI when undoing in browse screen 2021-03-12 18:54:08 +10:00
Damien Elmes
da2467838c undo in background, and show progress window 2021-03-12 17:54:56 +10:00
Damien Elmes
c52df814a4 experiment with perform_op() wrapper
Fixes #1065, and gives us similar functionality to #1066
2021-03-12 17:54:13 +10:00
Damien Elmes
b9581b94fb 'change deck' now undoable 2021-03-12 16:27:57 +10:00
Damien Elmes
5b52f0e931 consume original card when updating 2021-03-12 16:20:58 +10:00
Damien Elmes
fef8c402e0 make 'forget card' undoable; remove checkpoint() in set_due_date 2021-03-12 16:13:50 +10:00
Damien Elmes
37ebeaa119 fix set due date not remembering default in browse screen 2021-03-12 15:47:11 +10:00
Damien Elmes
18a8d458bb Revert "Merge pull request #1066 from RumovZ/editor-save-dec"
This reverts commit 994081be34, reversing
changes made to 091ea67690.

@RumoVZ this broke a bunch of operations like 'select notes' and
'set due date'. When the triggered signal is connected to a function,
PyQt looks at the function signature to decide what arguments to pass
it. The wrapper was using *args, so PyQt passes in an extra argument,
which the underlying function didn't expect.

I tried settting __signature__ on the wrapper, but PyQT seems to
ignore it, so we may either need to check all of the existing calls
and add the ignored extra arguments, or create a separate wrapper for
such cases.
2021-03-12 15:44:19 +10:00
Damien Elmes
28cd625204 limit initial sort selection to new cards
https://github.com/ankidroid/Anki-Android/issues/8172
2021-03-12 14:58:19 +10:00
Damien Elmes
7f8d675e25 'set due date' now undoable 2021-03-12 14:50:31 +10:00
Damien Elmes
7e76c68c0c move old scheduler files into scheduler/
Includes a hack that should allow existing imports to continue to work;
if this breaks things for you, please let me know.
2021-03-12 14:43:45 +10:00
Damien Elmes
ab564315d8 split out common scheduler code into base.py, use scheduler/ dir
Also move the legacy aliases into a separate file
2021-03-12 14:07:52 +10:00
Damien Elmes
994081be34 Merge pull request #1066 from RumovZ/editor-save-dec
Add decorators for calling editor.saveNow()
2021-03-12 09:23:18 +10:00
RumovZ
fc787f1e9b Add decorator to save editor in sidebar 2021-03-11 22:25:18 +01:00
RumovZ
0def65a684 Add decorator to save editor in browser 2021-03-11 22:24:24 +01:00
Damien Elmes
091ea67690 enable deck removal undo again 2021-03-11 22:24:12 +10:00
Damien Elmes
755a12358b Merge pull request #1044 from RumovZ/sidebar-tools
Add sidebar modes for different click behaviour
2021-03-11 21:57:53 +10:00
RumovZ
b093d62f5a Merge branch 'master' into sidebar-tools 2021-03-11 12:08:32 +01:00
RumovZ
7d4f830322 Annotate decks.rem as deprecated 2021-03-11 11:26:35 +01:00
Damien Elmes
abf4ef9eac deck drag&drop undo 2021-03-11 20:02:16 +10:00
RumovZ
35902ef9fc Remove prompt when deleting from deckbrowser 2021-03-11 10:28:23 +01:00
Damien Elmes
f09c1d027c add a separate 'rename deck' method 2021-03-11 19:24:54 +10:00
RumovZ
a4e6f9791f Run background tasks with progress 2021-03-11 10:04:58 +01:00
RumovZ
193e7cc2aa Remove deck remove prompt but show card count 2021-03-11 09:52:11 +01:00
RumovZ
45fab1c043 Remove prompt when deleting saved searches 2021-03-11 09:20:41 +01:00
RumovZ
80444db6b0 Show count of affected notes after tag renaming 2021-03-11 09:17:22 +01:00
RumovZ
a5464de688 Show tooltip instead of prompt for removing tags 2021-03-11 09:14:50 +01:00
Damien Elmes
c89fea1174 split out remaining rpc methods
@david-allison-1 note this also changes the method index to start at
0 instead of 1
2021-03-11 17:04:32 +10:00
Damien Elmes
35a2022901 split out stats, media and search 2021-03-11 16:16:40 +10:00
Damien Elmes
ebc5695038 split out tags, deck config and card rendering 2021-03-11 16:05:06 +10:00
Damien Elmes
c30d3ee137 split out sync, notetypes and config code 2021-03-11 15:47:31 +10:00
Damien Elmes
7c09b73b6b rework backend codegen to support multiple services; split out sched
Rust requires all methods of impl Trait to be in a single file, which
means we had a giant backend/mod.rs covering all exposed methods. By
using separate service definitions for the separate areas, and updating
the code generation, we can split it into more manageable chunks -
this commit starts with the scheduling code.

In the long run, we'll probably want to split up the protobuf file into
multiple files as well.

Also dropped want_release_gil() from rsbridge, and the associated method
enum. While it allows us to skip the thread save/restore and mutex unlock/
lock, it looks to only be buying about 2.5% extra performance in the
best case (tested with timeit+format_timespan), and the majority of
the backend methods deal with I/O, and thus were already releasing the
GIL.
2021-03-11 14:51:29 +10:00
Damien Elmes
aec2934ac6 Merge pull request #1064 from BlueGreenMagick/fix-sidebar-click
Clicking the expander icon should not trigger click event
2021-03-11 10:19:55 +10:00
bluegreenmagick
270dac70f0 Clicking the expander icon should not trigger click event
Expander icon does not change currentIndex
2021-03-11 09:04:24 +09:00
Damien Elmes
a2b40846c7 Merge pull request #1063 from hgiesel/edithtmlfix
Fix bug with initially enabled toolbar in browser
2021-03-11 10:02:41 +10:00
RumovZ
53e98ce77f Fix repainting in case of tag renaming exception 2021-03-10 21:50:46 +01:00
Henrik Giesel
f5bf50ed02 Fix bug with initially enabled toolbar in browser 2021-03-10 19:28:08 +01:00
RumovZ
2ef4a10ccb Store name prefix of sidebar items 2021-03-10 16:38:29 +01:00
RumovZ
d11e9a5d3f Borrow dids in remove_decks_and_child_decks 2021-03-10 15:56:54 +01:00
Damien Elmes
78a37c7935 make sure we invalidate cache when undoing deck add 2021-03-10 23:59:40 +10:00
Damien Elmes
c2280cb776 undo support for deck adding/removing
Work in progress - still to do:
- renames appear as 'Update Deck' - easiest way to solve it would
be to have a separate backend method for renames
- drag&drop of decks not yet undoable
- since the undo status is updated after the backend method ends,
the older checkpoint() calls need to be replaced with an
update_undo_status() at the end of the call - if we just remove the
checkpoint, then the menu doesn't get updated
2021-03-10 23:50:11 +10:00
RumovZ
92aadcabcb Update about screen 2021-03-10 11:34:28 +01:00
RumovZ
c018c31985 Merge branch 'master' into sidebar-tools 2021-03-10 10:34:36 +01:00
RumovZ
e477b00c8d Disable renaming models and templates ...
... but add context action CLayout for templates.
2021-03-10 10:14:06 +01:00