From 634931cf9e6a488b08f0058a9150d31b7994dcd9 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 1 Apr 2020 17:13:08 +1000 Subject: [PATCH] tweak hook name --- qt/aqt/gui_hooks.py | 4 ++-- qt/aqt/tagedit.py | 2 +- qt/tools/genhooks_gui.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qt/aqt/gui_hooks.py b/qt/aqt/gui_hooks.py index 2e40815de..d3227e841 100644 --- a/qt/aqt/gui_hooks.py +++ b/qt/aqt/gui_hooks.py @@ -1928,7 +1928,7 @@ class _StyleDidInitFilter: style_did_init = _StyleDidInitFilter() -class _TagEditorReceivedAKeyHook: +class _TagEditorDidProcessKeyHook: _hooks: List[Callable[[TagEdit, QEvent], None]] = [] def append(self, cb: Callable[[TagEdit, QEvent], None]) -> None: @@ -1949,7 +1949,7 @@ class _TagEditorReceivedAKeyHook: raise -tag_editor_received_a_key = _TagEditorReceivedAKeyHook() +tag_editor_did_process_key = _TagEditorDidProcessKeyHook() class _TopToolbarDidInitLinksHook: diff --git a/qt/aqt/tagedit.py b/qt/aqt/tagedit.py index 2289ca737..bb050d40c 100644 --- a/qt/aqt/tagedit.py +++ b/qt/aqt/tagedit.py @@ -77,7 +77,7 @@ class TagEdit(QLineEdit): Qt.Key_Delete, ): self.showCompleter() - gui_hooks.tag_editor_received_a_key(self, evt) + gui_hooks.tag_editor_did_process_key(self, evt) def showCompleter(self): self.completer.setCompletionPrefix(self.text()) diff --git a/qt/tools/genhooks_gui.py b/qt/tools/genhooks_gui.py index e92055157..13e6400b2 100644 --- a/qt/tools/genhooks_gui.py +++ b/qt/tools/genhooks_gui.py @@ -511,7 +511,7 @@ def emptyNewCard(): ), # Tag ################### - Hook(name="tag_editor_received_a_key", args=["tag_edit: TagEdit", "evt: QEvent"]), + Hook(name="tag_editor_did_process_key", args=["tag_edit: TagEdit", "evt: QEvent"]), # Sound/video ################### Hook(name="av_player_will_play", args=["tag: anki.sound.AVTag"]),