From 9cc99cdcedfc67c0ad19587f2d993fcb97168ef1 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Sun, 21 Apr 2019 19:02:03 +1000 Subject: [PATCH] possible fix for " super-class ... Preferences was never called" Can't reproduce the issue, but it seems the user was able to open the preferences screen when no collection was loaded. If an error was caught in loadCollection() the main window was not being hidden, so perhaps a timing issue was preventing the profiles screen from taking modal focus. Removed the check in the prefs init - it is hopefully no longer necessary, and returning before QDialog.__init__() was called was causing the problem. Caught exception: File "aqt/webview.py", line 27, in cmd File "aqt/webview.py", line 85, in _onCmd File "aqt/webview.py", line 360, in _onBridgeCmd File "aqt/toolbar.py", line 56, in _linkHandler File "aqt/toolbar.py", line 80, in _syncLinkHandler File "aqt/main.py", line 669, in onSync File "aqt/main.py", line 365, in unloadCollection File "aqt/main.py", line 611, in closeAllWindows File "aqt/__init__.py", line 110, in closeAll : super-class __init__() of type Preferences was never called --- aqt/main.py | 1 + aqt/preferences.py | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/aqt/main.py b/aqt/main.py index 969472248..50bb60293 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -356,6 +356,7 @@ Debug info: self.col = None # return to profile manager + self.hide() self.showProfileManager() return False diff --git a/aqt/preferences.py b/aqt/preferences.py index 1b7e50dad..4a854c072 100644 --- a/aqt/preferences.py +++ b/aqt/preferences.py @@ -12,9 +12,6 @@ from anki.lang import _ class Preferences(QDialog): def __init__(self, mw): - if not mw.col: - showInfo(_("Please open a profile first.")) - return QDialog.__init__(self, mw, Qt.Window) self.mw = mw self.prof = self.mw.pm.profile