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)
|
||||
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
|
||||
@ -631,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()
|
||||
|
||||
|
||||
#
|
||||
# Entry
|
||||
|
34
README.md
34
README.md
@ -390,6 +390,40 @@ Below is a list of currently supported actions. Requests with invalid actions or
|
||||
```
|
||||
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**
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user