mirror of
https://github.com/ankitects/anki.git
synced 2026-01-10 12:33:55 -05:00
Added: Naive card info menu
This commit is contained in:
parent
7a64397eb7
commit
d96809cdfa
3 changed files with 18 additions and 3 deletions
|
|
@ -707,14 +707,21 @@ def play_avtags():
|
||||||
|
|
||||||
|
|
||||||
def open_reviewer_menu():
|
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 = {
|
REVIEWER_MENUS = {
|
||||||
"EditCurrent": aqt.mw.onEditCurrent,
|
"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)
|
req = openReviewerMenuRequest.FromString(request.data)
|
||||||
if req.HasField("current_card_id"):
|
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])
|
aqt.mw.taskman.run_on_main(REVIEWER_MENUS[req.name])
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.actionsSuspendCard(), shortcut: "@", onClick: todo },
|
||||||
{ name: tr.actionsOptions(), shortcut: "O", 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 },
|
{ name: tr.actionsPreviousCardInfo(), shortcut: "Ctrl+Alt+I", onClick: todo },
|
||||||
|
|
||||||
"hr",
|
"hr",
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,10 @@ export class ReviewerState {
|
||||||
this.displayMenu("SetDueDate");
|
this.displayMenu("SetDueDate");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public displayCardInfoMenu() {
|
||||||
|
this.displayMenu("CardInfo");
|
||||||
|
}
|
||||||
|
|
||||||
public buryCurrentCard() {
|
public buryCurrentCard() {
|
||||||
if (this.currentCard?.card?.id) {
|
if (this.currentCard?.card?.id) {
|
||||||
buryOrSuspendCards({
|
buryOrSuspendCards({
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue