mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
tweak hook name
This commit is contained in:
parent
28380d4183
commit
634931cf9e
3 changed files with 4 additions and 4 deletions
|
@ -1928,7 +1928,7 @@ class _StyleDidInitFilter:
|
||||||
style_did_init = _StyleDidInitFilter()
|
style_did_init = _StyleDidInitFilter()
|
||||||
|
|
||||||
|
|
||||||
class _TagEditorReceivedAKeyHook:
|
class _TagEditorDidProcessKeyHook:
|
||||||
_hooks: List[Callable[[TagEdit, QEvent], None]] = []
|
_hooks: List[Callable[[TagEdit, QEvent], None]] = []
|
||||||
|
|
||||||
def append(self, cb: Callable[[TagEdit, QEvent], None]) -> None:
|
def append(self, cb: Callable[[TagEdit, QEvent], None]) -> None:
|
||||||
|
@ -1949,7 +1949,7 @@ class _TagEditorReceivedAKeyHook:
|
||||||
raise
|
raise
|
||||||
|
|
||||||
|
|
||||||
tag_editor_received_a_key = _TagEditorReceivedAKeyHook()
|
tag_editor_did_process_key = _TagEditorDidProcessKeyHook()
|
||||||
|
|
||||||
|
|
||||||
class _TopToolbarDidInitLinksHook:
|
class _TopToolbarDidInitLinksHook:
|
||||||
|
|
|
@ -77,7 +77,7 @@ class TagEdit(QLineEdit):
|
||||||
Qt.Key_Delete,
|
Qt.Key_Delete,
|
||||||
):
|
):
|
||||||
self.showCompleter()
|
self.showCompleter()
|
||||||
gui_hooks.tag_editor_received_a_key(self, evt)
|
gui_hooks.tag_editor_did_process_key(self, evt)
|
||||||
|
|
||||||
def showCompleter(self):
|
def showCompleter(self):
|
||||||
self.completer.setCompletionPrefix(self.text())
|
self.completer.setCompletionPrefix(self.text())
|
||||||
|
|
|
@ -511,7 +511,7 @@ def emptyNewCard():
|
||||||
),
|
),
|
||||||
# Tag
|
# 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
|
# Sound/video
|
||||||
###################
|
###################
|
||||||
Hook(name="av_player_will_play", args=["tag: anki.sound.AVTag"]),
|
Hook(name="av_player_will_play", args=["tag: anki.sound.AVTag"]),
|
||||||
|
|
Loading…
Reference in a new issue