Commit Graph

39 Commits

Author SHA1 Message Date
ANH
9cf07a98c2 add shortcut for reviewer context menu 2020-08-23 17:46:47 +03:00
Damien Elmes
2a8a4e9780 fix formatting & lint 2020-08-21 12:36:18 +10:00
Thomas B
897ec72608 Fixing type hints
Matched all type hints, changed the original Sequence[] type hint for _answerButtonList() in reviewer.py on mypy's recommendation.
2020-08-19 16:15:49 -04:00
Thomas B
e92b0f8d63 Bugfix proposed filter post-testing
Mirrored filter more closely on _ReviewerWillAnswerCardFilter, including taking and returning the value to be modified.
2020-08-18 10:37:45 -04:00
Thomas B
7be08919e2 Add hook for initializing answer buttons 2020-08-14 13:52:20 -04:00
ANH
b4b12f1642 add reviewer_will_play_question_sounds and reviewer_will_play_answer_sounds hooks 2020-07-30 22:20:19 +03:00
Damien Elmes
4a69b55a90 add note/card removal to backend 2020-06-04 18:21:04 +10:00
Damien Elmes
12b8fe6147 don't hide static template text when card is empty 2020-05-13 11:17:44 +10:00
Damien Elmes
eec3fcf87a use qconnect everywhere, and fix some typing issues
a step towards check_untyped_defs in aqt, but there's still 100+
issues to resolve
2020-05-04 13:23:08 +10:00
Damien Elmes
351d8a309f move autoplay() into card 2020-04-13 09:04:30 +10:00
Damien Elmes
10eb947402 fix replay audio again, and decouple the code from the reviewer 2020-04-13 08:59:36 +10:00
Damien Elmes
8b3f0100e4 fix error when replaying audio in preview screen 2020-04-10 20:33:48 +10:00
Damien Elmes
5f9c126caa fix some errors in the previewing code 2020-04-03 09:00:08 +10:00
evandrocoan
4bb0a75fe7 Give the 'typearrow' id to the type answer arrow 2020-03-16 00:42:08 -03:00
Damien Elmes
8845b05933 make sure audio queue is cleared when transitioning between cards
https://anki.tenderapp.com/discussions/beta-testing/1846-anki-2122-beta#comment_48150139
2020-03-14 20:04:40 +10:00
Alan Du
6c2dda6c9c Monkeytype qt/aqt/reviewer.py 2020-03-01 10:16:08 -05:00
Damien Elmes
db69f84c0a interrupt current audio when autoplay off 2020-02-25 17:49:06 +10:00
Glutanimate
0e5dea4c9f Assume that web assets without a specified subpath are under /_anki
Maintains compatibility with existing add-ons
2020-02-15 15:03:43 +01:00
Glutanimate
bbd667b0ff Add webview_will_set_content hook & update supporting code accordingly 2020-02-12 22:00:13 +01:00
Damien Elmes
7fcb6b5672 pass instance to webview_did_receive_js_message instead of string 2020-02-09 08:59:29 +10:00
Glutanimate
68c5fd50f9 Equip Reviewer._showAnswer with hooks covering common add-on usages 2020-01-24 15:36:05 +01:00
Damien Elmes
17ebdfc099 extract and flag AV tags as part of the render process
We can now show replay buttons for the audio contained in {{FrontSide}}
without having to play it again when the answer is shown.

The template code now always defers FrontSide rendering, as it wasn't
a big saving, and meant the logic had to be implemented twice.
2020-01-24 11:06:11 +10:00
Damien Elmes
7dcbc7efec basic night mode support
Forces the Fusion theme when running night mode, so we don't need
to work around platform themes that don't respond to the defined
palette.

Feedback/suggestions on the chosen colours welcome - _vars.scss is the
file to change if you want to experiment with adjustments.
2020-01-23 17:27:07 +10:00
Damien Elmes
8236f800ae add pause and seek forward/back shortcuts to review screen 2020-01-22 12:50:33 +10:00
Damien Elmes
d54f719558 add a webview_did_receive_js_message hook 2020-01-22 11:06:12 +10:00
Damien Elmes
f92bb55c25 add option in prefs to hide replay audio buttons 2020-01-21 21:00:17 +10:00
Damien Elmes
7b3d701ad5 add replay buttons to reviewing screen 2020-01-21 14:47:03 +10:00
Damien Elmes
02ec3f149c update qt/ to use the new API 2020-01-20 20:10:38 +10:00
Damien Elmes
8310cb7a0e add qconnect helper and some type hints
The type hints allow mypy to check the gui_hook calls, revealing a
bunch of places that are broken as they expect no arguments like the
legacy hooks.

To make mypy happy about PyQt's signal.connect(func), a qconnect()
helper has been added.
2020-01-16 07:41:23 +10:00
Damien Elmes
b09e7e8247 more tweaks for readability/consistency 2020-01-15 17:45:35 +10:00
Damien Elmes
cab572b63c remove _hook/_filter suffix 2020-01-15 16:53:24 +10:00
Damien Elmes
b2f756f1b7 tweak the hook names in anki/
still a work in progress
2020-01-15 16:43:22 +10:00
Damien Elmes
97bd86e0ad tidy hooks, add reviewCleanup 2020-01-15 13:03:11 +10:00
Damien Elmes
660685375f migrate most of the remaining runHook() calls 2020-01-15 12:46:53 +10:00
Damien Elmes
84c17e1f02 add more hooks, tweak wording for consistency 2020-01-15 12:16:54 +10:00
Damien Elmes
662eb53e6a switch to classes for hooks
This allows us to add a docstring to .append() so users can see
the names of the arguments that are being passed, and means we
don't have to remember to prepend run_ when calling a hook.
2020-01-14 08:54:07 +10:00
Damien Elmes
d266dcd076 add a flag to handle the legacy hook missing args case
And update a few more hooks.
2020-01-13 18:37:08 +10:00
Damien Elmes
dd61389319 New type-safe approach to hooks/filters
Still todo:
- Add separate module for GUI hooks
- Update the remaining runHook/runFilter() calls
- Document the changes, including defensive registration
2020-01-13 13:57:51 +10:00
Damien Elmes
5876866565 tweaking the folder names again
hopefully that's the last of it
2020-01-03 07:48:38 +10:00