Esempio n. 1
0
 def _linkHandler(self, url: str) -> bool:
     if url == "study":
         self.mw.col.startTimebox()
         self.mw.moveToState("review")
         if self.mw.state == "overview":
             tooltip(tr.studying_no_cards_are_due_yet())
     elif url == "anki":
         print("anki menu")
     elif url == "opts":
         display_options_for_deck(self.mw.col.decks.current())
     elif url == "cram":
         aqt.dialogs.open("FilteredDeckConfigDialog", self.mw)
     elif url == "refresh":
         self.rebuild_current_filtered_deck()
     elif url == "empty":
         self.empty_current_filtered_deck()
     elif url == "decks":
         self.mw.moveToState("deckBrowser")
     elif url == "review":
         openLink(f"{aqt.appShared}info/{self.sid}?v={self.sidVer}")
     elif url == "studymore" or url == "customStudy":
         self.onStudyMore()
     elif url == "unbury":
         self.on_unbury()
     elif url == "description":
         self.edit_description()
     elif url.lower().startswith("http"):
         openLink(url)
     return False
Esempio n. 2
0
 def _shortcutKeys(self) -> list[tuple[str, Callable]]:
     return [
         ("o", lambda: display_options_for_deck(self.mw.col.decks.current())),
         ("r", self.rebuild_current_filtered_deck),
         ("e", self.empty_current_filtered_deck),
         ("c", self.onCustomStudyKey),
         ("u", self.on_unbury),
     ]