diff --git a/qt/aqt/exporting.py b/qt/aqt/exporting.py index 0ad18c3d5..2298aa641 100644 --- a/qt/aqt/exporting.py +++ b/qt/aqt/exporting.py @@ -196,6 +196,7 @@ class ExportDialog(QDialog): else: self.on_export_finished() + gui_hooks.legacy_exporter_will_export(self.exporter.ext) if self.isVerbatim: gui_hooks.collection_will_temporarily_close(self.mw.col) self.mw.progress.start() @@ -213,6 +214,7 @@ class ExportDialog(QDialog): msg = tr.exporting_note_exported(count=self.exporter.count) else: msg = tr.exporting_card_exported(count=self.exporter.count) + gui_hooks.legacy_exporter_did_export(self.exporter.ext) tooltip(msg, period=3000) QDialog.reject(self) diff --git a/qt/tools/genhooks_gui.py b/qt/tools/genhooks_gui.py index c947f135f..7bf6959d3 100644 --- a/qt/tools/genhooks_gui.py +++ b/qt/tools/genhooks_gui.py @@ -816,6 +816,8 @@ gui_hooks.webview_did_inject_style_into_page.append(mytest) `output` provides access to the unused/missing file lists and the text output that will be shown in the Check Media screen.""", ), + # Importing/exporting data + ################### Hook( name="exporter_will_export", args=[ @@ -844,6 +846,16 @@ gui_hooks.webview_did_inject_style_into_page.append(mytest) ], doc="""Called after collection and deck exports.""", ), + Hook( + name="legacy_exporter_will_export", + args=["file_extension: str"], + doc="""Called before collection and deck exports performed by legacy exporters.""", + ), + Hook( + name="legacy_exporter_did_export", + args=["file_extension: str"], + doc="""Called after collection and deck exports performed by legacy exporters.""", + ), # Dialog Manager ################### Hook(