Thomas B
830ab9cedb
Add hook for initializing answer buttons
2020-08-14 13:52:20 -04:00
Arthur Milchior
110f4c664f
Any removed
2020-08-12 01:37:21 +02:00
Henrik Giesel
7d1d20cbf4
Add editor_will_munge_html hook
2020-08-08 23:27:58 +02:00
ANH
9a768fc198
fix typo
2020-07-31 04:41:49 +03:00
ANH
0eb48d3603
document hooks
2020-07-31 03:06:13 +03:00
ANH
23d0008a6f
add reviewer_will_play_question_sounds and reviewer_will_play_answer_sounds hooks
2020-07-30 22:20:19 +03:00
Glutanimate
7056765179
Fix type annotation for old stats dialog class
2020-07-17 03:08:09 +02:00
Glutanimate
b7c8374095
Add a couple of hooks to trigger add-on actions before showing stats
2020-07-16 21:48:46 +02:00
Glutanimate
ee8696cbf3
Add top_toolbar_did_redraw hook
...
Notifies add-ons of the top toolbar being redrawn
2020-07-10 17:38:40 +02:00
Arthur Milchior
f9b0f6e7b3
hook: history_line
...
I expect to use this hook to create an add-on which will simply remove
the ",,". By ignoring empty fields I expect to make this easier to
use.
2020-06-08 20:47:01 +02:00
evandrocoan
0ca8cd4e4d
Add missing quotes to typecheck-setup.sh for paths with spaces on
...
the name.
2020-06-02 21:37:58 -03:00
Damien Elmes
86689c5e77
more fixes for bundled Qt types
2020-06-03 09:55:30 +10:00
Damien Elmes
7716e3b17e
Switch to PyQt 5.15's (slightly broken) built-in stubs
2020-06-02 17:52:18 +10:00
Glutanimate
96b3b29a6f
Add main_window_did_init hook and clarify difference to profile_did_open
2020-05-28 13:30:22 +02:00
Henrik Giesel
91d7cd29b2
Satisfy black reformatter
2020-05-23 11:14:52 +02:00
Henrik Giesel
ae57c6fbeb
Add three deck config hooks
...
- gui_hooks.deck_conf_did_add_config
- gui_hooks.deck_conf_will_remove_config
- gui_hooks.deck_conf_will_rename_config
2020-05-22 21:24:05 +02:00
Damien Elmes
d31f2d8c23
move deck/notetype update hooks to gui
...
We need to migrate away from firing hooks in libanki, since libanki
methods may be running on a background thread, and hook consumers
typically expect the code to run in the main thread. We could document
it, but it would frequently be forgotten about, and could lead to
crashes.
https://anki.tenderapp.com/discussions/ankidesktop/41748-qobject-cannot-create-children-for-a-parent-that-is-in-a-different-thread-when-hitting-the-save-button-on-clayoutpy-window
2020-05-22 10:47:14 +10:00
Damien Elmes
b3e8c63d65
update missed storage._Collection references
2020-05-20 19:45:46 +10:00
Damien Elmes
1e3080ebdc
update empty cards hook
...
Closes #515
2020-05-20 13:41:09 +10:00
Arthur Milchior
952d943440
hook add_card_did_init
2020-04-03 11:03:08 +02:00
Damien Elmes
0359a6ae38
tweak hook name
2020-04-01 17:13:08 +10:00
Arthur Milchior
102670a5a6
hook tag_editor_received_a_key
...
I expect it to be useful for add-ons such as
https://github.com/fonol/anki-search-inside-add-card which interact
with the tag line
2020-03-31 15:05:41 +02:00
Damien Elmes
2fdca03043
Merge pull request #531 from Arthur-Milchior/browser_will_show_context_menu
...
hook browser_header_will_show_context_menu
2020-03-28 14:50:02 +10:00
Arthur Milchior
015d07ec56
hook browser_header_will_show_context_menu
2020-03-27 23:06:22 +01:00
evandrocoan
964cc1a11a
Merge remote-tracking branch 'danielelmes/master' into create_actions_for_windows_macos
...
# Conflicts:
# .github/scripts/trailing-newlines.sh
# .github/workflows/checks.yml
# Makefile
# pylib/Makefile
# qt/Makefile
# qt/tools/typecheck-setup.sh
# rspy/Makefile
2020-03-24 22:49:49 -03:00
Arthur Milchior
3ecf8352f5
Hook editor_note_will_load
...
A current problem I have is that there is nothing similar to hook
inside of javascript. It seems that it would be easier to be able to
add other methods in javascript and call them in loadNote. Currently I
simply redefined loadNote, which is far from perfect
2020-03-24 10:17:01 +01:00
Damien Elmes
792dd69b98
Merge pull request #522 from Arthur-Milchior/editor_did_init
...
editor_did_init
2020-03-24 15:52:50 +10:00
evandrocoan
02d8728683
Created .github/workflows/mac_checks.yml
2020-03-24 00:31:46 -03:00
evandrocoan
4fcecaed9f
Created the .github/workflows/windows.yml
...
# Conflicts:
# .github/scripts/trailing-newlines.sh
# Makefile
# qt/tools/typecheck-setup.sh
# react/Makefile
# rspy/Makefile
# svelte/Makefile
# tslib/Makefile
2020-03-23 19:51:03 -03:00
evandrocoan
b376b78527
Deprecated eval usage on qt/tools/typecheck-setup.sh
2020-03-23 18:54:24 -03:00
evandrocoan
093af85c2e
Merge remote-tracking branch 'danielelmes/master' into fix_tests_on_windows
...
# Conflicts:
# .github/scripts/trailing-newlines.sh
2020-03-23 18:44:11 -03:00
Arthur Milchior
77309d3034
editor_did_init
...
That would be useful to add elements in the editor, such as in multi
column editor
2020-03-22 17:15:47 +01:00
Damien Elmes
eab7686d2f
remove old finder code; add search hooks to browser & remove old one
2020-03-21 16:38:46 +10:00
Damien Elmes
f6472f7430
tweak add-on wording
2020-03-20 21:00:21 +10:00
Damien Elmes
1accffbd34
Merge pull request #517 from Arthur-Milchior/backup_is_done
...
hook backup_is_done
2020-03-20 20:56:33 +10:00
Damien Elmes
9a36800ddb
Merge pull request #470 from Arthur-Milchior/accept_card
...
Hook to decide whether a note should be added.
2020-03-20 20:56:04 +10:00
Arthur Milchior
7192ee96ac
hook backup_is_done
...
I expect to use this hook in add-on 529955533. It'll serve me to
create long term backup at the same time than your backup
2020-03-19 13:21:00 +01:00
Arthur Milchior
6e85e8ccce
Hook models_advanced_will_show
...
This will be useful for add-on 1863928230. I want to let users change
the LaTeX footer/header everywhere.
2020-03-19 12:03:09 +01:00
Arthur Milchior
339bbd88a8
Hook to decide whether a note should be added.
2020-03-19 03:39:53 +01:00
evandrocoan
c4e94ddc20
Fixed typecheck-setup.sh: sudo: command not found on Windows
2020-03-17 19:48:16 -03:00
Arthur Milchior
19e7163c2f
Hook editor_web_view_did_init
...
I hope to use this in oder to had features to the web view. In
particular, I expect the "spell checking" feature to use it
hopefully. Because currently it's incompatible with other add-on
dealing with the editor
2020-03-16 04:37:07 +01:00
Arthur Milchior
7dd2c3ec43
hook single_addon_selected
2020-03-09 12:45:10 +01:00
Arthur Milchior
9f1415a811
hook addons_dialog_will_show
2020-03-09 12:45:10 +01:00
Arthur Milchior
490441b9a7
hook debug_ran_hook
2020-03-06 15:01:22 +01:00
Arthur Milchior
932412993a
hook debug_will_show_hook
2020-03-06 15:01:02 +01:00
Arthur Milchior
3cca0bb132
config_unprettify_json
2020-03-04 08:25:14 +01:00
Arthur Milchior
ea03fcc526
hook prettify_json
2020-03-04 08:25:14 +01:00
Damien Elmes
53b2122461
Merge pull request #476 from Arthur-Milchior/hook_browser_init
...
Hook browser init
2020-03-02 15:40:10 +10:00
Arthur Milchior
e45878c2ee
hook for initializing clayout
2020-03-01 11:42:41 +01:00
Arthur Milchior
57efc22d99
browser_did_init
2020-03-01 11:39:41 +01:00
Arthur Milchior
a1da483906
move deck_browser hooks apart
2020-02-29 17:01:38 +01:00
Arthur Milchior
f20b0e43cd
indicate that card_will_show belong to multiple windows
2020-02-28 13:34:48 +01:00
evandrocoan
4a2456f62f
Merge remote-tracking branch 'danielelmes/master' into fix_windows_build
...
# Conflicts:
# Makefile
2020-02-27 00:20:34 -03:00
Damien Elmes
fcc965e81a
Merge pull request #462 from Arthur-Milchior/filter_empty_card
...
Add a hook to change empty cards to delete
2020-02-27 12:53:52 +10:00
Arthur Milchior
228db67c93
Add a hook to change empty cards to delete
2020-02-26 10:59:34 -08:00
Damien Elmes
7d691d7571
don't abort build if mo file fails; rename files for consistency
...
Issues are now checked for in CI, so there's no need to break the
build for everyone each time there's a problem with the gettext
catalogs.
2020-02-26 17:47:02 +10:00
evandrocoan
2d316748a7
Merge remote-tracking branch 'danielelmes/master' into fix_windows_build
...
# Conflicts:
# Makefile
2020-02-25 03:16:57 -03:00
Damien Elmes
d26a68f20e
Merge pull request #458 from glutanimate/add-deck-conf-hooks
...
Add deck options hooks
2020-02-25 13:38:04 +10:00
evandrocoan
5fab701431
Added -o pipefail to all set -e ensuring the build fails when some
...
operation with pipe exits error status.
# Conflicts:
# Makefile
2020-02-24 20:18:56 -03:00
evandrocoan
6d16298254
Fixed development compilation with Windows 10
...
1. Documented on README.development how to setup the environment
for Windows.
2. Fixed qt/ts/package.json not working due usage of ; instead
of &&
3. Fixed copy-qt-files rsync using Windows paths instead of Unix
ones
4. Fixed Makefile's using Windows Linux Subsystem bash instead of
the Cygwin one.
5. Ensured running the correct pip module by using python -m pip
instead of just pip.
6. Fixed Makefiles using Windows `find` command, instead of the
Cygwin's one (POSIX find).
7. Fixed pyenv sourcing/activate using /pyevn/bin/ instead of
/python/Scripts/ on Windows.
8. Fixed pyaudio not installing/linking with portaudio on Windows
by installing for a patched fork at evandroforks/pyaudio
9. Forked and fixed portaudio not building with Visual Studio 2017
or superior and added the reference for the patched fork on
README.development at evandroforks/portaudio.
2020-02-24 14:59:11 -03:00
Glutanimate
f7b256a860
Use a consistent function signature across load and save hooks
2020-02-24 15:47:48 +01:00
Glutanimate
d1dc0362b6
Add deck_conf_did_setup_ui_form hook
...
Called earlier than deck_conf_will_show, allowing add-on authors
to perform UI modifications before the deck config is loaded.
2020-02-24 15:29:23 +01:00
Glutanimate
368a485847
Add hooks for extending the deck options dialog
...
Introduces three new hooks:
* deck_conf_will_show: Allows adding or modifying widgets
* deck_conf_did_load_config: Allows add-on widgets to read from config
* deck_conf_will_save_config: Allows add-on widgets to write to config
2020-02-24 13:42:30 +01:00
Damien Elmes
d270a01b61
update extract-po-string
...
- use fluent.syntax for output (only non-plural case for now)
- add confirmation step
2020-02-23 17:58:43 +10:00
Glutanimate
af2c353aa7
Update 'top_toolbar_did_init_links' hook
2020-02-20 16:23:33 +01:00
Glutanimate
05f5b4d664
Merge branch 'master' into top_toolbar_links_hook
2020-02-20 15:17:48 +01:00
Damien Elmes
0a562c2eac
Merge pull request #449 from glutanimate/html-content-section-hooks
...
Add hooks for modifying HTML body sections in the deck browser and overview screens
2020-02-18 08:20:01 +10:00
Glutanimate
0e95badd80
Add overview_will_render_content hook
2020-02-17 16:49:21 +01:00
Glutanimate
803b0432f1
Bundle individual section hooks together into one
...
Uses new dataclass 'DeckBrowserContent'
2020-02-17 16:26:21 +01:00
Damien Elmes
e9884a4b14
add extra hook for media sync start/stop
2020-02-17 08:40:17 +10:00
Damien Elmes
738e415463
connect media sync progress to Python, add a progress dialog
2020-02-17 08:40:16 +10:00
Glutanimate
c3c31d1454
Add deck_browser_will_render_section hook
...
Allows add-on authors to specifcally target and modify individual
sections of the deck browser HTML body at string composition time.
2020-02-16 19:29:01 +01:00
Damien Elmes
415cb15661
Merge pull request #447 from glutanimate/browser-sidebar-tree-hooks
...
Add browser_will_build_tree filter
2020-02-16 08:36:28 +10:00
Glutanimate
5378587f67
Add top_toolbar_did_init_links hook
...
Allows extending the links in the top toolbar, in a similar
fashion to editor_did_init_shortcuts
2020-02-15 23:21:23 +01:00
Glutanimate
b7e0d4388a
Add browser_will_build_tree filter
...
Allows add-ons to populate the browser sidebar tree with their own
items, and/or take over specific construction stages in their
entirety
2020-02-15 21:03:15 +01:00
Glutanimate
356eda66f4
Update documentation for webview_will_set_content and WebContent
2020-02-15 15:03:58 +01:00
Glutanimate
d7836e3af8
Add webview_will_set_content hook & update supporting code accordingly
2020-02-12 22:00:13 +01:00
Damien Elmes
fc40182335
pass instance to webview_did_receive_js_message instead of string
2020-02-09 08:59:29 +10:00
Arthur Milchior
0d23f5dafb
Allow to change main window when overview/deckbrowser is shown
2020-02-08 08:09:12 -08:00
Glutanimate
dbe8e8f6e1
Fix formatting error
2020-01-24 15:48:05 +01:00
Glutanimate
b1cecb08d4
Equip Reviewer._showAnswer with hooks covering common add-on usages
2020-01-24 15:36:05 +01:00
Damien Elmes
35435a130e
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
712779886a
add a hook for when playback begins
2020-01-22 14:41:32 +10:00
Damien Elmes
4f9c9e1770
add a webview_did_receive_js_message hook
2020-01-22 11:06:12 +10:00
Damien Elmes
7bf4c9f08f
get mpv slave mode working with new API
...
Also move the mpv-specific hooks into AVPlayer
2020-01-20 22:01:38 +10:00
Damien Elmes
b22dc71810
more tweaks for readability/consistency
2020-01-15 17:45:35 +10:00
Damien Elmes
dd780b2898
more hook tweaks, and merge the pre-render field and template hooks
2020-01-15 17:18:11 +10:00
Damien Elmes
f6ccde1c2f
tidy hooks, add reviewCleanup
2020-01-15 13:03:11 +10:00
Damien Elmes
aa0300af90
migrate most of the remaining runHook() calls
2020-01-15 12:46:53 +10:00
Damien Elmes
550264b1e5
add more hooks, tweak wording for consistency
2020-01-15 12:16:54 +10:00
Damien Elmes
ac9470dd5f
move hook gen code out of anki/
...
It's not needed at runtime, and this allows hooks to be updated
even when the code is broken.
2020-01-15 09:11:20 +10:00
Damien Elmes
80d7333c9d
add some more hooks; stringify fully qualified types
...
To avoid circular imports, types that contain a '.' are automatically
converted to strings.
2020-01-15 08:56:56 +10:00
Damien Elmes
555d1f0e55
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
3d94af972e
update the rest of the anki/ hooks/filters
2020-01-13 17:59:52 +10:00
Damien Elmes
aa8b1645a7
add separate file for gui hooks
2020-01-13 14:38:05 +10:00
Damien Elmes
df2cc2fb02
switch from nose2 to pytest
...
pytest will show what differs in simple assert statements
concurrent mode is supported with a plugin, but like nose2, concurrent
mode hides the cause of import errors, so I've left it off for now.
2020-01-03 08:52:10 +10:00
Damien Elmes
2a00e0a6b0
tweaking the folder names again
...
hopefully that's the last of it
2020-01-03 07:48:38 +10:00