Commit graph

2217 commits

Author SHA1 Message Date
Damien Elmes
0767754ca6 enable redo support
Also:

- fix issues where the Undo action in the Browse screen was not
consistent with the main window. The existing hook signature has been
changed; from a snapshot of the add-on code from a few months ago, it
was not a hook that was being used by anyone.
- change the undo shortcut in the Browse window to match the main
window. It was different because undoing a change in the editing area
could accidentally trigger an undo of an operation, but the damage is
limited now that (most) operations can be redone. If it still proves to
be a problem, perhaps we should just always swallow ctrl+z when an
editing field is focused.
2021-05-19 15:18:39 +10:00
RumovZ
f220165c0f Fix black workaround for format calls 2021-05-18 22:19:09 +02:00
Damien Elmes
f4ddf90399 Merge pull request #1170 from RumovZ/fix-columns
Fix column issues
2021-05-18 09:24:15 +10:00
Damien Elmes
4a18f1841f fix detection of shift key at startup
Our regular helper doesn't appear to work during startup.
2021-05-18 09:21:02 +10:00
Damien Elmes
c267a1d0e1 PreviewDialog was missing from top level browser module 2021-05-18 09:10:28 +10:00
RumovZ
0ef8a2e802 Set column sizes and indicator after state change 2021-05-17 20:13:45 +02:00
RumovZ
58a18eb261 Block events when restoring headers
Restoring headers after switching states was triggering
_on_column_toggled(), leading to unexpected results.
2021-05-17 20:07:52 +02:00
RumovZ
6f12d48ad5 Make failed sort column change a no-op
The previous behaviour when a non-sortable column was clicked was to
trigger the sorting routine, which was usually a no-op, but would
reorder rows if the configured sort column was hidden.
2021-05-17 18:33:59 +02:00
Damien Elmes
5bd3884a71 support card state mutator in test scheduler
Documentation to come
2021-05-17 16:59:02 +10:00
Damien Elmes
19071fce7c experiment with learning count on deck list 2021-05-16 20:23:39 +10:00
Damien Elmes
a42648a418 fix test scheduler undo + implement look-ahead
Instead of using a separate undo queue, the code now defers checking for
newly-due learning cards until the answering stage, and logs the updated
cutoff time as an undoable change, so that any newly-due learning cards
won't appear instead of a new/review card that was just undone.

Queue redo now uses a similar approach to undo, instead of rebuilding the
queues.
2021-05-14 22:16:53 +10:00
Damien Elmes
78b431cbf1 work around Windows issue on latest Black
Thanks Rumo!
552a53495e
2021-05-13 20:15:51 +10:00
Damien Elmes
9f49dca545 re-enable leech notification for test scheduler 2021-05-13 15:51:02 +10:00
Damien Elmes
5f7590c4b4 expose new sorting options in test scheduler options; move things around 2021-05-13 15:23:16 +10:00
Damien Elmes
7e324a6ec0 use new API for test scheduler
Avoids duplicate work, and is a step towards allowing the next
states to be modified by third-party code.

Also:

- fixed incorrect underlined count, due to reviews being labeled as
learning cards
- fixed reviewer not refreshing when undoing a test review, by splitting
up backend queue rebuilding from frontend reviewer refresh
- moved answering into a CollectionOp
2021-05-11 13:06:03 +10:00
Damien Elmes
5e44a34f20 expose step counter and undone op changes in hook 2021-05-08 17:51:36 +10:00
Damien Elmes
d6eeab3722 remove some unnecessary checkpoints 2021-05-08 17:04:05 +10:00
Damien Elmes
2e312eb13d update find_duplicates to use QueryOp/CollectionOp 2021-05-08 16:58:18 +10:00
Damien Elmes
db415b08e4 move query_op into operations/, and add the ability to show progress 2021-05-08 16:35:43 +10:00
Damien Elmes
34c26a8b1c split browser dialogs into separate files 2021-05-08 15:08:45 +10:00
Damien Elmes
d8cea1385c the find_and_replace alias is not required
Was only added recently, so nothing should depend on it yet.
2021-05-08 14:34:57 +10:00
Damien Elmes
9c51aa5a64 move "find duplicates" into separate file
As far as I'm aware, no add-ons were extending that screen, so I've
dropped the old context object and the export in browser/__init__.py
2021-05-08 14:33:43 +10:00
Damien Elmes
6dd78b0ea5 Merge pull request #1159 from hgiesel/newapproach
Prefer idiomatic Svelte features over dynamic components
2021-05-08 11:35:31 +10:00
Henrik Giesel
755b39b59e Check for id when inserting dynamic elements
* I'm not sure it behaved, if there were multiple elements
  inserted by different add-ons into the same container
2021-05-07 16:50:17 +02:00
Henrik Giesel
840191d358 Use json.dumps instead of backticks in editor.py 2021-05-07 14:22:06 +02:00
Damien Elmes
26e9fba1f7 update docstrings for latest black 2021-05-07 18:12:56 +10:00
Damien Elmes
4242d82adf fix find&replace 2021-05-07 14:02:40 +10:00
Henrik Giesel
8c32691d30 Fix Preview Button after changing from f-string to normal string 2021-05-07 02:12:37 +02:00
Henrik Giesel
bb2fb8e9f5 Fix ButtonDropdown 2021-05-07 02:04:44 +02:00
Henrik Giesel
95b6b386dc Only initialize extension apis if necessary 2021-05-07 02:04:44 +02:00
Henrik Giesel
d92a0c44c7 Add lefttopbtns as AddonButtons 2021-05-07 02:04:44 +02:00
Henrik Giesel
dd99524ae0 Enable setting of PreviewButton and hiding of cloze button again 2021-05-07 02:04:42 +02:00
Henrik Giesel
a51eb42e7b Simplify structure of EditorToolbar and ButtonGroup in editor HTML file 2021-05-07 02:03:55 +02:00
Damien Elmes
83aa43d97b remove AnkiDroid timezone confirmation
By the time this update reaches stable, AnkiDroid 2.15 should already
be out.
2021-05-06 19:05:15 +10:00
Damien Elmes
b0e59df5a8 fix dmypy action 2021-05-05 15:54:41 +10:00
Damien Elmes
1802066afe support undo for (renamed) unbury_deck() action 2021-04-30 20:03:20 +10:00
Damien Elmes
e468daa060 undoing of notetype templates 2021-04-30 17:30:48 +10:00
Damien Elmes
e161b9049a undoing of notetype fields
- fix stale cache issue
- update add cards screen in response to op changes
2021-04-30 17:15:59 +10:00
Damien Elmes
3049eaf47c notetype rename+options undo 2021-04-30 16:09:44 +10:00
Damien Elmes
46bcfa00fd notetype removal undoable 2021-04-30 16:01:47 +10:00
Damien Elmes
8a9796ee5a update GUI to allow notetype addition undo
- backend now updates current notetype as part of addition
- frontend no longer implicitly adds, so we can assign a new name and
add in a single operation
2021-04-30 15:58:08 +10:00
RumovZ
8e0298120d Add separate no_arg_trigger decorator 2021-04-26 08:46:08 +02:00
Damien Elmes
532840bbfc Merge pull request #1154 from RumovZ/fix-skip-dec
Fix skip_if_selection_is_empty() for triggers
2021-04-26 09:21:42 +10:00
RumovZ
7ac84a38d6 Remove some unnecessary lambdas 2021-04-25 19:51:57 +02:00
RumovZ
4b91c2b9f1 Fix skip_if_selection_is_empty() for triggers
It seems to be enough if one decorator calls pyqtSlot(), but to avoid
problems in the future, let's have all decorators do that.
2021-04-25 19:50:56 +02:00
Henrik Giesel
b0988e43e1 Move EditorToolbar API into EditorToolbar.svelte 2021-04-25 19:15:00 +02:00
Henrik Giesel
a21a4d330b Initialize editor toolbar via function, not web component 2021-04-25 18:32:01 +02:00
Damien Elmes
68a4f4bade Merge pull request #1151 from RumovZ/no-sel-dec
Fix some problems with browser actions while selection is empty
2021-04-25 20:48:40 +10:00
Damien Elmes
1a6c5f594d enable the new deck options by default
- The old options are still available with a shift+click
- Translations still need updating
- See d8ca46e6e9 for some examples
of extending the screen in an add-on
2021-04-25 19:58:58 +10:00
Damien Elmes
f3b344a571 fix error when user cancels out of set due date/reposition 2021-04-25 19:33:25 +10:00