Don't automatically disable add-ons

d7a0bc0d42 (commitcomment-130467314)

Also, make the pop-up non-modal so it can be left on screen as the user
navigates to the add-on screen.
This commit is contained in:
Damien Elmes 2023-10-20 11:09:11 +10:00
parent 7bc4c3b78f
commit 1b8f5496f9
2 changed files with 16 additions and 7 deletions

View file

@ -5,9 +5,13 @@ addons-failed-to-load =
When loading '{ $name }':
{ $traceback }
addons-failed-to-load2 =
The following add-ons failed to load, so they have been disabled:
The following add-ons failed to load:
{ $addons }
Use Tools>Add-ons to check for updates. For add-ons that don't have
an update available, you can disable or delete the add-on to prevent this
message from appearing.
addons-startup-failed = Add-on Startup Failed
# Shown in the add-on configuration screen (Tools>Add-ons>Config), in the title bar
addons-config-window-title = Configure '{ $name }'
addons-config-validation-error = There was a problem with the provided configuration: { $problem }, at path { $path }, against schema { $schema }.

View file

@ -241,7 +241,6 @@ class AddonManager:
except AbortAddonImport:
pass
except:
self.toggleEnabled(addon.dir_name, enable=False)
name = html.escape(addon.human_name())
page = addon.page()
if page:
@ -252,16 +251,22 @@ class AddonManager:
if broken:
addons = "\n\n- " + "\n- ".join(broken)
addons = f"<div style='white-space: pre-wrap'>{addons}</div>"
error = tr.addons_failed_to_load2(
addons=addons,
)
txt = f"<h1>{tr.qt_misc_error()}</h1>{error}"
showText(
txt,
txt = f"# {tr.addons_startup_failed()}\n{error}"
html2 = markdown.markdown(txt)
print(html2)
(diag, _) = showText(
html2,
type="html",
copyBtn=True,
run=False,
)
from aqt import mw
# calling show immediately appears to crash
mw.progress.single_shot(1000, diag.show)
def onAddonsDialog(self) -> None:
aqt.dialogs.open("AddonsDialog", self)