mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Add hook to onDelete in AddonsDialog (#1232)
* add hook * add me to CONTRIBUTORS * adjust hook to comments * Update CONTRIBUTORS
This commit is contained in:
parent
220fca9a1d
commit
066a2e8e1d
3 changed files with 7 additions and 0 deletions
|
@ -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>
|
||||
|
||||
********************
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue