diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 79d88e832..57ffceebf 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -104,7 +104,7 @@ wisherhxl dobefore <1432338032@qq.com> Bart Louwers Sam Penny -Mateus Etto +Yutsuten ******************** diff --git a/qt/aqt/reviewer.py b/qt/aqt/reviewer.py index 90d3f5454..dbfc5fddb 100644 --- a/qt/aqt/reviewer.py +++ b/qt/aqt/reviewer.py @@ -1051,23 +1051,27 @@ time = %(time)d; op.run_in_background() def suspend_current_note(self) -> None: + gui_hooks.reviewer_will_suspend_note(self.card.nid) suspend_note( parent=self.mw, note_ids=[self.card.nid], ).success(lambda _: tooltip(tr.studying_note_suspended())).run_in_background() def suspend_current_card(self) -> None: + gui_hooks.reviewer_will_suspend_card(self.card.id) suspend_cards( parent=self.mw, card_ids=[self.card.id], ).success(lambda _: tooltip(tr.studying_card_suspended())).run_in_background() def bury_current_note(self) -> None: + gui_hooks.reviewer_will_bury_note(self.card.nid) bury_notes(parent=self.mw, note_ids=[self.card.nid],).success( lambda res: tooltip(tr.studying_cards_buried(count=res.count)) ).run_in_background() def bury_current_card(self) -> None: + gui_hooks.reviewer_will_bury_card(self.card.id) bury_cards(parent=self.mw, card_ids=[self.card.id],).success( lambda res: tooltip(tr.studying_cards_buried(count=res.count)) ).run_in_background() diff --git a/qt/tools/genhooks_gui.py b/qt/tools/genhooks_gui.py index 90ff794bd..6efe0125f 100644 --- a/qt/tools/genhooks_gui.py +++ b/qt/tools/genhooks_gui.py @@ -198,6 +198,22 @@ hooks = [ return_type="str", doc="""Used to inspect and modify a recording recorded by "Record Own Voice" before replaying.""", ), + Hook( + name="reviewer_will_suspend_note", + args=["nid: int"], + ), + Hook( + name="reviewer_will_suspend_card", + args=["id: int"], + ), + Hook( + name="reviewer_will_bury_note", + args=["nid: int"], + ), + Hook( + name="reviewer_will_bury_card", + args=["id: int"], + ), # Debug ################### Hook(