mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
Merge pull request #76 from sagittarian/state-change-hooks
Add hooks before and after a state change.
This commit is contained in:
commit
0233ecdb38
1 changed files with 2 additions and 0 deletions
|
@ -383,7 +383,9 @@ the manual for information on how to restore from an automatic backup."))
|
||||||
if cleanup:
|
if cleanup:
|
||||||
cleanup(state)
|
cleanup(state)
|
||||||
self.state = state
|
self.state = state
|
||||||
|
runHook('beforeStateChange', state, oldState, *args)
|
||||||
getattr(self, "_"+state+"State")(oldState, *args)
|
getattr(self, "_"+state+"State")(oldState, *args)
|
||||||
|
runHook('afterStateChange', state, oldState, *args)
|
||||||
|
|
||||||
def _deckBrowserState(self, oldState):
|
def _deckBrowserState(self, oldState):
|
||||||
self.deckBrowser.show()
|
self.deckBrowser.show()
|
||||||
|
|
Loading…
Reference in a new issue