mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Add did-add-field-hook analogous to did-delete-field (#2574)
* Add add field hook analogous to delete field * Add myself to contributors
This commit is contained in:
parent
e0862bbc19
commit
f076fa28af
3 changed files with 7 additions and 0 deletions
|
@ -127,6 +127,7 @@ Christopher Woggon <christopher.woggon@gmail.com>
|
|||
Kavel Rao <github.com/kavelrao>
|
||||
Ben Yip <github.com/bennyyip>
|
||||
mmjang <752515918@qq.com>
|
||||
3ter <github.com/3ter>
|
||||
|
||||
********************
|
||||
|
||||
|
|
|
@ -186,6 +186,8 @@ class FieldDialog(QDialog):
|
|||
self.saveField()
|
||||
f = self.mm.new_field(name)
|
||||
self.mm.add_field(self.model, f)
|
||||
gui_hooks.fields_did_add_field(self, f)
|
||||
|
||||
self.fillFields()
|
||||
self.form.fieldList.setCurrentRow(len(self.model["flds"]) - 1)
|
||||
|
||||
|
|
|
@ -1244,6 +1244,10 @@ gui_hooks.webview_did_inject_style_into_page.append(mytest)
|
|||
),
|
||||
# Fields
|
||||
###################
|
||||
Hook(
|
||||
name="fields_did_add_field",
|
||||
args=["dialog: aqt.fields.FieldDialog", "field: anki.models.FieldDict"],
|
||||
),
|
||||
Hook(
|
||||
name="fields_did_rename_field",
|
||||
args=[
|
||||
|
|
Loading…
Reference in a new issue