Merge pull request #12 from txgio/deck-browser-and-deck-overview
Include actions to open the Deck Overview for a given deck name and go to the Deck Browser
This commit is contained in:
commit
a626da9df9
@ -507,6 +507,18 @@ class AnkiBridge:
|
|||||||
reviewer._answerCard(ease)
|
reviewer._answerCard(ease)
|
||||||
return True
|
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")
|
||||||
|
|
||||||
#
|
#
|
||||||
# AnkiConnect
|
# AnkiConnect
|
||||||
@ -630,6 +642,12 @@ class AnkiConnect:
|
|||||||
|
|
||||||
def api_guiShowAnswer(self):
|
def api_guiShowAnswer(self):
|
||||||
return self.anki.guiShowAnswer()
|
return self.anki.guiShowAnswer()
|
||||||
|
|
||||||
|
def api_guiDeckOverview(self, name):
|
||||||
|
return self.anki.guiDeckOverview(name)
|
||||||
|
|
||||||
|
def api_guiDeckBrowser(self):
|
||||||
|
return self.anki.guiDeckBrowser()
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
34
README.md
34
README.md
@ -390,6 +390,40 @@ Below is a list of currently supported actions. Requests with invalid actions or
|
|||||||
```
|
```
|
||||||
true
|
true
|
||||||
```
|
```
|
||||||
|
* **guiDeckOverview**
|
||||||
|
|
||||||
|
Opens the Deck Overview screen for the deck with the given name; returns `true` if succeeded or `false` otherwise.
|
||||||
|
|
||||||
|
*Sample request*:
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"action": "guiDeckOverview",
|
||||||
|
"params": {
|
||||||
|
"name": "Default"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*Sample response*:
|
||||||
|
```
|
||||||
|
true
|
||||||
|
```
|
||||||
|
|
||||||
|
* **guiDeckBrowser**
|
||||||
|
|
||||||
|
Opens the Deck Browser screen.
|
||||||
|
|
||||||
|
*Sample request*:
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"action": "guiDeckBrowser"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
*Sample response*:
|
||||||
|
```
|
||||||
|
null
|
||||||
|
```
|
||||||
|
|
||||||
* **upgrade**
|
* **upgrade**
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user