mirror of
https://github.com/ankitects/anki.git
synced 2026-01-07 02:53:54 -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():
|
||||
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])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -108,6 +108,10 @@ export class ReviewerState {
|
|||
this.displayMenu("SetDueDate");
|
||||
}
|
||||
|
||||
public displayCardInfoMenu() {
|
||||
this.displayMenu("CardInfo");
|
||||
}
|
||||
|
||||
public buryCurrentCard() {
|
||||
if (this.currentCard?.card?.id) {
|
||||
buryOrSuspendCards({
|
||||
|
|
|
|||
Loading…
Reference in a new issue