mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 23:42:23 -04:00
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:
parent
3a4f94ab86
commit
441e279f6d
2 changed files with 3 additions and 3 deletions
|
@ -41,7 +41,7 @@ class AnkiQt(QMainWindow):
|
||||||
self.col: Optional[_Collection] = None
|
self.col: Optional[_Collection] = None
|
||||||
aqt.mw = self
|
aqt.mw = self
|
||||||
self.app = app
|
self.app = app
|
||||||
self.pm = profileManager
|
self.pm: ProfileManager = profileManager
|
||||||
# init rest of app
|
# init rest of app
|
||||||
self.safeMode = self.app.queryKeyboardModifiers() & Qt.ShiftModifier
|
self.safeMode = self.app.queryKeyboardModifiers() & Qt.ShiftModifier
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -216,11 +216,11 @@ Not currently enabled; click the sync button in the main window to enable."""))
|
||||||
# Basic & Advanced Options
|
# Basic & Advanced Options
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
def setupOptions(self):
|
def setupOptions(self) -> None:
|
||||||
self.form.pastePNG.setChecked(self.prof.get("pastePNG", False))
|
self.form.pastePNG.setChecked(self.prof.get("pastePNG", False))
|
||||||
self.form.uiScale.setValue(self.mw.pm.uiScale()*100)
|
self.form.uiScale.setValue(self.mw.pm.uiScale()*100)
|
||||||
|
|
||||||
def updateOptions(self):
|
def updateOptions(self) -> None:
|
||||||
self.prof['pastePNG'] = self.form.pastePNG.isChecked()
|
self.prof['pastePNG'] = self.form.pastePNG.isChecked()
|
||||||
newScale = self.form.uiScale.value()/100
|
newScale = self.form.uiScale.value()/100
|
||||||
if newScale != self.mw.pm.uiScale():
|
if newScale != self.mw.pm.uiScale():
|
||||||
|
|
Loading…
Reference in a new issue