add signatures to calling code

otherwise mypy ignores them. And even then, it's not smart enough
to notice self.mw.pm.setUiScale("foo") is invalid unless the
instance assignment in main has a type hint as well
This commit is contained in:
Damien Elmes 2019-12-19 11:34:46 +10:00
parent 3a4f94ab86
commit 441e279f6d
2 changed files with 3 additions and 3 deletions

View file

@ -41,7 +41,7 @@ class AnkiQt(QMainWindow):
self.col: Optional[_Collection] = None
aqt.mw = self
self.app = app
self.pm = profileManager
self.pm: ProfileManager = profileManager
# init rest of app
self.safeMode = self.app.queryKeyboardModifiers() & Qt.ShiftModifier
try:

View file

@ -216,11 +216,11 @@ Not currently enabled; click the sync button in the main window to enable."""))
# Basic & Advanced Options
######################################################################
def setupOptions(self):
def setupOptions(self) -> None:
self.form.pastePNG.setChecked(self.prof.get("pastePNG", False))
self.form.uiScale.setValue(self.mw.pm.uiScale()*100)
def updateOptions(self):
def updateOptions(self) -> None:
self.prof['pastePNG'] = self.form.pastePNG.isChecked()
newScale = self.form.uiScale.value()/100
if newScale != self.mw.pm.uiScale():