Open AddonsDialog via dialog manager

This commit is contained in:
Henrik Giesel 2020-12-26 18:07:37 +01:00
parent 398e7d7845
commit 44fb7e3dc2
2 changed files with 5 additions and 2 deletions

View File

@ -69,7 +69,7 @@ except ImportError as e:
# - make preferences modal? cmd+q does wrong thing # - make preferences modal? cmd+q does wrong thing
from aqt import addcards, browser, editcurrent # isort:skip from aqt import addcards, addons, browser, editcurrent # isort:skip
from aqt import stats, about, preferences, mediasync # isort:skip from aqt import stats, about, preferences, mediasync # isort:skip
@ -77,6 +77,7 @@ class DialogManager:
_dialogs: Dict[str, list] = { _dialogs: Dict[str, list] = {
"AddCards": [addcards.AddCards, None], "AddCards": [addcards.AddCards, None],
"AddonsDialog": [addons.AddonsDialog, None],
"Browser": [browser.Browser, None], "Browser": [browser.Browser, None],
"EditCurrent": [editcurrent.EditCurrent, None], "EditCurrent": [editcurrent.EditCurrent, None],
"DeckStats": [stats.DeckStats, None], "DeckStats": [stats.DeckStats, None],

View File

@ -218,7 +218,7 @@ class AddonManager:
) )
def onAddonsDialog(self) -> None: def onAddonsDialog(self) -> None:
AddonsDialog(self) aqt.dialogs.open("AddonsDialog", self)
# Metadata # Metadata
###################################################################### ######################################################################
@ -731,6 +731,8 @@ class AddonsDialog(QDialog):
def reject(self) -> None: def reject(self) -> None:
saveGeom(self, "addons") saveGeom(self, "addons")
aqt.dialogs.markClosed("AddonsDialog")
return QDialog.reject(self) return QDialog.reject(self)
def name_for_addon_list(self, addon: AddonMeta) -> str: def name_for_addon_list(self, addon: AddonMeta) -> str: