Merge pull request #493 from glutanimate/type-annotate-editor-card

Type-annotate editor.card
This commit is contained in:
Damien Elmes 2020-03-05 07:26:40 +10:00 committed by GitHub
commit 94b90d23fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -868,7 +868,7 @@ QTableView {{ gridline-color: {grid} }}
else: else:
self.editor.setNote(self.card.note(reload=True), focusTo=self.focusTo) self.editor.setNote(self.card.note(reload=True), focusTo=self.focusTo)
self.focusTo = None self.focusTo = None
self.editor.card = self.card # type: ignore self.editor.card = self.card
self.singleCard = True self.singleCard = True
self._updateFlagsMenu() self._updateFlagsMenu()
gui_hooks.browser_did_change_row(self) gui_hooks.browser_did_change_row(self)

View File

@ -19,6 +19,7 @@ from bs4 import BeautifulSoup
import aqt import aqt
import aqt.sound import aqt.sound
from anki.cards import Card
from anki.hooks import runFilter from anki.hooks import runFilter
from anki.httpclient import HttpClient from anki.httpclient import HttpClient
from anki.lang import _ from anki.lang import _
@ -77,7 +78,7 @@ class Editor:
self.addMode = addMode self.addMode = addMode
self.currentField: Optional[int] = None self.currentField: Optional[int] = None
# current card, for card layout # current card, for card layout
self.card = None self.card: Optional[Card] = None
self.setupOuter() self.setupOuter()
self.setupWeb() self.setupWeb()
self.setupShortcuts() self.setupShortcuts()