diff --git a/aqt/__init__.py b/aqt/__init__.py index 002b6f814..5aacc26d9 100644 --- a/aqt/__init__.py +++ b/aqt/__init__.py @@ -27,6 +27,7 @@ appUpdate="https://ankiweb.net/update/desktop" appHelpSite=HELP_SITE from aqt.main import AnkiQt +from aqt.profiles import ProfileManager mw: Optional[AnkiQt] = None # set on init @@ -130,7 +131,7 @@ dialogs = DialogManager() _gtrans: Optional[Any] = None _qtrans: Optional[QTranslator] = None -def setupLang(pm, app, force=None): +def setupLang(pm: ProfileManager, app: QApplication, force: Optional[str]=None) -> None: global _gtrans, _qtrans try: locale.setlocale(locale.LC_ALL, '') @@ -303,7 +304,6 @@ def _run(argv=None, exec=True): opts, args = parseArgs(argv) # profile manager - from aqt.profiles import ProfileManager pm = ProfileManager(opts.base) pmLoadResult = pm.setupMeta() diff --git a/aqt/browser.py b/aqt/browser.py index 26901e42d..afa819877 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -10,6 +10,7 @@ import unicodedata from operator import itemgetter from typing import Callable, List, Dict, Optional +from anki.collection import _Collection from anki.lang import ngettext import json @@ -512,6 +513,9 @@ class SidebarModel(QAbstractItemModel): # fixme: respond to reset+edit hooks class Browser(QMainWindow): + model: DataModel + mw: AnkiQt + col: _Collection def __init__(self, mw: AnkiQt): QMainWindow.__init__(self, None, Qt.Window) diff --git a/aqt/deckbrowser.py b/aqt/deckbrowser.py index f90b6b060..4223b5aa8 100644 --- a/aqt/deckbrowser.py +++ b/aqt/deckbrowser.py @@ -1,6 +1,7 @@ # Copyright: Ankitects Pty Ltd and contributors # -*- coding: utf-8 -*- # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html +from typing import Any from aqt.qt import * from aqt.utils import askUser, getOnlyText, openLink, showWarning, shortcut, \ @@ -14,6 +15,7 @@ from copy import deepcopy from anki.lang import _, ngettext class DeckBrowser: + _dueTree: Any def __init__(self, mw): self.mw = mw diff --git a/aqt/utils.py b/aqt/utils.py index 9a4ac7d99..6f8ef1423 100644 --- a/aqt/utils.py +++ b/aqt/utils.py @@ -426,7 +426,7 @@ def downArrow(): ###################################################################### _tooltipTimer: Optional[QTimer] = None -_tooltipLabel: Optional[str] = None +_tooltipLabel: Optional[QLabel] = None def tooltip(msg, period=3000, parent=None): global _tooltipTimer, _tooltipLabel