From 5629533b3895bf0bf9e4143f18516b81d483967e Mon Sep 17 00:00:00 2001 From: Adam Mesha Date: Tue, 22 Apr 2014 01:16:39 +0300 Subject: [PATCH] Add hooks before and after a state change. Useful for plugin authors. --- aqt/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aqt/main.py b/aqt/main.py index 19ab5ea81..05c28c684 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -383,7 +383,9 @@ the manual for information on how to restore from an automatic backup.")) if cleanup: cleanup(state) self.state = state + runHook('beforeStateChange', state, oldState, *args) getattr(self, "_"+state+"State")(oldState, *args) + runHook('afterStateChange', state, oldState, *args) def _deckBrowserState(self, oldState): self.deckBrowser.show()