diff --git a/CONTRIBUTORS b/CONTRIBUTORS index bacefc3cb..08a58695c 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -127,6 +127,7 @@ Christopher Woggon Kavel Rao Ben Yip mmjang <752515918@qq.com> +3ter ******************** diff --git a/qt/aqt/fields.py b/qt/aqt/fields.py index 141300500..57d5aa843 100644 --- a/qt/aqt/fields.py +++ b/qt/aqt/fields.py @@ -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) diff --git a/qt/tools/genhooks_gui.py b/qt/tools/genhooks_gui.py index 7e049ee50..8cbdb586a 100644 --- a/qt/tools/genhooks_gui.py +++ b/qt/tools/genhooks_gui.py @@ -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=[