Supply deck ID in hook, so that add-ons may update deck config dict

(for newly created filtered decks where the deck ID is not yet set
in the FilteredDeckForUpdate object)
This commit is contained in:
Glutanimate 2021-03-25 02:33:15 +01:00
parent e9b18c14f2
commit feaa32b751
2 changed files with 4 additions and 1 deletions

View File

@ -303,7 +303,9 @@ class FilteredDeckConfigDialog(QDialog):
return return
def success(out: OpChangesWithID) -> None: def success(out: OpChangesWithID) -> None:
gui_hooks.filtered_deck_dialog_did_add_or_update_deck(self, self.deck) gui_hooks.filtered_deck_dialog_did_add_or_update_deck(
self, self.deck, out.id
)
saveGeom(self, self.GEOMETRY_KEY) saveGeom(self, self.GEOMETRY_KEY)
aqt.dialogs.markClosed(self.DIALOG_KEY) aqt.dialogs.markClosed(self.DIALOG_KEY)
QDialog.accept(self) QDialog.accept(self)

View File

@ -307,6 +307,7 @@ hooks = [
args=[ args=[
"filtered_deck_dialog: aqt.filtered_deck.FilteredDeckConfigDialog", "filtered_deck_dialog: aqt.filtered_deck.FilteredDeckConfigDialog",
"filtered_deck: anki.scheduler.FilteredDeckForUpdate", "filtered_deck: anki.scheduler.FilteredDeckForUpdate",
"deck_id: int",
], ],
doc="Allows performing changes after a filtered deck has been added or updated", doc="Allows performing changes after a filtered deck has been added or updated",
), ),