Commit Graph

71 Commits

Author SHA1 Message Date
Henrik Giesel
bff42d55db Add main_window_will_require_reset hook 2020-08-16 18:56:32 +02:00
Arthur Milchior
c4db4bd291 Any removed 2020-08-12 01:37:21 +02:00
Henrik Giesel
7f9e560396 Add editor_will_munge_html hook 2020-08-08 23:27:58 +02:00
ANH
6df4cf765e fix typo 2020-07-31 04:41:49 +03:00
ANH
b4604873c4 document hooks 2020-07-31 03:06:13 +03:00
ANH
b4b12f1642 add reviewer_will_play_question_sounds and reviewer_will_play_answer_sounds hooks 2020-07-30 22:20:19 +03:00
Glutanimate
0fedf5c825 Fix type annotation for old stats dialog class 2020-07-17 03:08:09 +02:00
Glutanimate
b89811bfba Add a couple of hooks to trigger add-on actions before showing stats 2020-07-16 21:48:46 +02:00
Glutanimate
15fd3a4856 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
c81a9b3d61 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
Glutanimate
6147356330 Add main_window_did_init hook and clarify difference to profile_did_open 2020-05-28 13:30:22 +02:00
Henrik Giesel
788a3eeced Satisfy black reformatter 2020-05-23 11:14:52 +02:00
Henrik Giesel
2074ffcf51 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
9baa8530d5 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
e2bb5cd14a update missed storage._Collection references 2020-05-20 19:45:46 +10:00
Damien Elmes
4fd8a4cf2d update empty cards hook
Closes #515
2020-05-20 13:41:09 +10:00
Arthur Milchior
657fa9758b hook add_card_did_init 2020-04-03 11:03:08 +02:00
Damien Elmes
634931cf9e tweak hook name 2020-04-01 17:13:08 +10:00
Arthur Milchior
4b34e71030 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
Arthur Milchior
4bb49d404e hook browser_header_will_show_context_menu 2020-03-27 23:06:22 +01:00
Arthur Milchior
31f18e3c94 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
Arthur Milchior
f2f92fb0c3 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
9afbcd4178 remove old finder code; add search hooks to browser & remove old one 2020-03-21 16:38:46 +10:00
Damien Elmes
0d43e9dca3 tweak add-on wording 2020-03-20 21:00:21 +10:00
Damien Elmes
b7c64aaf39
Merge pull request #517 from Arthur-Milchior/backup_is_done
hook backup_is_done
2020-03-20 20:56:33 +10:00
Damien Elmes
f274e85edf
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
bfc305fa26 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
b73507344c 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
e4ae41340f Hook to decide whether a note should be added. 2020-03-19 03:39:53 +01:00
Arthur Milchior
89bb5fe79b 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
74b2b18966 hook single_addon_selected 2020-03-09 12:45:10 +01:00
Arthur Milchior
4e1838bba8 hook addons_dialog_will_show 2020-03-09 12:45:10 +01:00
Arthur Milchior
5adbc33d4c hook debug_ran_hook 2020-03-06 15:01:22 +01:00
Arthur Milchior
3319b114de hook debug_will_show_hook 2020-03-06 15:01:02 +01:00
Arthur Milchior
bc67268d82 config_unprettify_json 2020-03-04 08:25:14 +01:00
Arthur Milchior
e4986c7784 hook prettify_json 2020-03-04 08:25:14 +01:00
Damien Elmes
5cf7d6672e
Merge pull request #476 from Arthur-Milchior/hook_browser_init
Hook browser init
2020-03-02 15:40:10 +10:00
Arthur Milchior
80ba217772 hook for initializing clayout 2020-03-01 11:42:41 +01:00
Arthur Milchior
047e027e01 browser_did_init 2020-03-01 11:39:41 +01:00
Arthur Milchior
f81134830b move deck_browser hooks apart 2020-02-29 17:01:38 +01:00
Arthur Milchior
5c5860eabc indicate that card_will_show belong to multiple windows 2020-02-28 13:34:48 +01:00
Arthur Milchior
5ff1f3890f Add a hook to change empty cards to delete 2020-02-26 10:59:34 -08:00
Glutanimate
8454e27efb Use a consistent function signature across load and save hooks 2020-02-24 15:47:48 +01:00
Glutanimate
7cc9311b79 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
335047187a 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
Glutanimate
dfefd67508 Update 'top_toolbar_did_init_links' hook 2020-02-20 16:23:33 +01:00
Glutanimate
33f7d7ed50 Merge branch 'master' into top_toolbar_links_hook 2020-02-20 15:17:48 +01:00
Damien Elmes
c5156a0f6b
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
f7ae2fa1f7 Add overview_will_render_content hook 2020-02-17 16:49:21 +01:00
Glutanimate
8ff1a2e770 Bundle individual section hooks together into one
Uses new dataclass 'DeckBrowserContent'
2020-02-17 16:26:21 +01:00