diff --git a/qt/aqt/addcards.py b/qt/aqt/addcards.py index ef8a11500..b0dd4c6a5 100644 --- a/qt/aqt/addcards.py +++ b/qt/aqt/addcards.py @@ -188,8 +188,8 @@ class AddCards(QMainWindow): self.editor.loadNote( focusTo=min(self.editor.last_field_index or 0, len(new_note.fields) - 1) ) - gui_hooks.add_cards_did_change_note_type( - old_note.note_type(), new_note.note_type() + gui_hooks.addcards_did_change_note_type( + self, old_note.note_type(), new_note.note_type() ) def _load_new_note(self, sticky_fields_from: Optional[Note] = None) -> None: diff --git a/qt/tools/genhooks_gui.py b/qt/tools/genhooks_gui.py index 8cbdb586a..14a39915c 100644 --- a/qt/tools/genhooks_gui.py +++ b/qt/tools/genhooks_gui.py @@ -1013,6 +1013,19 @@ gui_hooks.webview_did_inject_style_into_page.append(mytest) Hook( name="add_cards_did_change_note_type", args=["old: anki.models.NoteType", "new: anki.models.NoteType"], + doc="""Deprecated. Use addcards_did_change_note_type instead. + Executed after the user selects a new note type when adding + cards.""", + ), + Hook( + name="addcards_did_change_note_type", + args=[ + "addcards: aqt.addcards.AddCards", + "old: anki.models.NoteType", + "new: anki.models.NoteType", + ], + replaces="add_cards_did_change_note_type", + replaced_hook_args=["old: anki.models.NoteType", "new: anki.models.NoteType"], doc="""Executed after the user selects a new note type when adding cards.""", ),