Add hooks before and after a state change.

Useful for plugin authors.
This commit is contained in:
Adam Mesha 2014-04-22 01:16:39 +03:00
parent 89c9af7445
commit 5629533b38

View file

@ -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()