Added: Naive card info menu

This commit is contained in:
Luc Mcgrady 2025-11-11 13:33:14 +00:00
parent 7a64397eb7
commit d96809cdfa
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C
3 changed files with 18 additions and 3 deletions

View file

@ -707,14 +707,21 @@ def play_avtags():
def open_reviewer_menu():
reviewer = aqt.mw.reviewer
def on_card_info():
reviewer._card_info.set_card(reviewer.card)
reviewer.on_card_info()
REVIEWER_MENUS = {
"EditCurrent": aqt.mw.onEditCurrent,
"SetDueDate": aqt.mw.reviewer.on_set_due,
"SetDueDate": reviewer.on_set_due,
"CardInfo": on_card_info,
}
req = openReviewerMenuRequest.FromString(request.data)
if req.HasField("current_card_id"):
aqt.mw.reviewer.card = aqt.mw.col.get_card(CardId(req.current_card_id))
reviewer.card = aqt.mw.col.get_card(CardId(req.current_card_id))
aqt.mw.taskman.run_on_main(REVIEWER_MENUS[req.name])

View file

@ -42,7 +42,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
},
{ name: tr.actionsSuspendCard(), shortcut: "@", onClick: todo },
{ name: tr.actionsOptions(), shortcut: "O", onClick: todo },
{ name: tr.actionsCardInfo(), shortcut: "I", onClick: todo },
{
name: tr.actionsCardInfo(),
shortcut: "I",
onClick: state.displayCardInfoMenu.bind(state),
},
{ name: tr.actionsPreviousCardInfo(), shortcut: "Ctrl+Alt+I", onClick: todo },
"hr",

View file

@ -108,6 +108,10 @@ export class ReviewerState {
this.displayMenu("SetDueDate");
}
public displayCardInfoMenu() {
this.displayMenu("CardInfo");
}
public buryCurrentCard() {
if (this.currentCard?.card?.id) {
buryOrSuspendCards({