From 17c928627c158749d5fe75d585d83b49b3adaa2e Mon Sep 17 00:00:00 2001 From: tomasgodoi Date: Sun, 2 Jul 2017 14:35:14 -0300 Subject: [PATCH] Including actions to go to a deck overview by name and to got to the deck browser screen. --- AnkiConnect.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/AnkiConnect.py b/AnkiConnect.py index 024c0dc..9eb6595 100644 --- a/AnkiConnect.py +++ b/AnkiConnect.py @@ -507,6 +507,19 @@ class AnkiBridge: reviewer._answerCard(ease) return True + def guiDeckOverview(self, name): + collection = self.collection() + if collection is not None: + deck = collection.decks.byName(name) + if (deck is not None): + collection.decks.select(deck['id']) + self.window().onOverview() + return True + return False + + def guiDeckBrowser(self): + self.window().moveToState("deckBrowser") + return True # # AnkiConnect @@ -630,6 +643,12 @@ class AnkiConnect: def api_guiShowAnswer(self): return self.anki.guiShowAnswer() + + def api_guiDeckOverview(self, name): + return self.anki.guiDeckOverview(name) + + def api_guiDeckBrowser(self): + return self.anki.guiDeckBrowser() #