diff --git a/aqt/__init__.py b/aqt/__init__.py index 49ac71d49..b9b4f56f5 100644 --- a/aqt/__init__.py +++ b/aqt/__init__.py @@ -392,12 +392,14 @@ environment points to a valid, writable folder.""", ) return + if pmLoadResult.firstTime: + pm.setDefaultLang() + if pmLoadResult.loadError: QMessageBox.warning( None, "Preferences Corrupt", - """\ - Anki's prefs21.db file was corrupt and has been recreated. If you were using multiple \ + """Anki's prefs21.db file was corrupt and has been recreated. If you were using multiple \ profiles, please add them back using the same names to recover your cards.""", ) diff --git a/aqt/profiles.py b/aqt/profiles.py index 64980feb3..4e2e956b9 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -385,7 +385,6 @@ create table if not exists profiles "insert or replace into profiles values ('_global', ?)", self._pickle(metaConf), ) - self._setDefaultLang() return result def _ensureProfile(self): @@ -409,7 +408,7 @@ please see: ###################################################################### # On first run, allow the user to choose the default language - def _setDefaultLang(self): + def setDefaultLang(self): # create dialog class NoCloseDiag(QDialog): def reject(self): @@ -452,7 +451,7 @@ please see: None, "Anki", en % name, QMessageBox.Yes | QMessageBox.No, QMessageBox.No ) if r != QMessageBox.Yes: - return self._setDefaultLang() + return self.setDefaultLang() self.setLang(code) def setLang(self, code): diff --git a/aqt/webview.py b/aqt/webview.py index a3c7b4dbc..19211efcb 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -417,6 +417,7 @@ body {{ zoom: {}; background: {}; {} }} def _onHeight(self, qvar): from aqt import mw + if qvar is None: mw.progress.timer(1000, mw.reset, False)