Add hook to onDelete in AddonsDialog (#1232)

* add hook

* add me to CONTRIBUTORS

* adjust hook to comments

* Update CONTRIBUTORS
This commit is contained in:
Thore 2021-06-15 02:01:29 +02:00 committed by GitHub
parent 220fca9a1d
commit 066a2e8e1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View file

@ -82,6 +82,7 @@ Matthias Metelka <github.com/kleinerpirat>
qubist-pixel-ux <github.com/qubist-pixel-ux>
cherryblossom <github.com/cherryblossom000>
Hikaru Yoshiga <github.com/hikaru-y>
Thore Tyborski <github.com/ThoreBor>
********************

View file

@ -846,6 +846,7 @@ class AddonsDialog(QDialog):
return
if not askUser(tr.addons_delete_the_numd_selected_addon(count=len(selected))):
return
gui_hooks.addons_dialog_will_delete_addons(self, selected)
for dir in selected:
if not self.mgr.deleteAddon(dir):
break

View file

@ -876,6 +876,11 @@ gui_hooks.webview_did_inject_style_into_page.append(mytest)
args=["dialog: aqt.addons.AddonsDialog", "add_on: aqt.addons.AddonMeta"],
doc="""Allows doing an action when a single add-on is selected.""",
),
Hook(
name="addons_dialog_will_delete_addons",
args=["dialog: aqt.addons.AddonsDialog", "ids: List[str]"],
doc="""Allows doing an action before an add-on is deleted.""",
),
# Model
###################
Hook(