tweak hook name

This commit is contained in:
Damien Elmes 2020-04-01 17:13:08 +10:00
parent 28380d4183
commit 634931cf9e
3 changed files with 4 additions and 4 deletions

View File

@ -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:

View File

@ -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())

View File

@ -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"]),