From 8ba7d831a1b8da01ba9e86491d7740f674910a53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 26 Jul 2016 22:59:41 +0200 Subject: Make callbacks when key is ready --- helpers/key.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'helpers/key.py') diff --git a/helpers/key.py b/helpers/key.py index bf46eeb..7ad0565 100644 --- a/helpers/key.py +++ b/helpers/key.py @@ -30,7 +30,8 @@ class Key(ButtonBehavior, Widget): { 'trigger': 'fail', 'source': 'configuring', - 'dest': 'failed' + 'dest': 'failed', + 'after': 'key_loaded_callback' }, { 'trigger': 'success', @@ -42,6 +43,7 @@ class Key(ButtonBehavior, Widget): 'trigger': 'no_config', 'source': 'configuring', 'dest': 'loaded_no_config', + 'after': 'key_loaded_callback' }, { 'trigger': 'load', @@ -51,22 +53,26 @@ class Key(ButtonBehavior, Widget): { 'trigger': 'fail', 'source': 'loading', - 'dest': 'failed' + 'dest': 'failed', + 'after': 'key_loaded_callback' }, { 'trigger': 'success', 'source': 'loading', - 'dest': 'loaded' + 'dest': 'loaded', + 'after': 'key_loaded_callback' }, { 'trigger': 'no_actions', 'source': 'loading', 'dest': 'loaded_no_actions', + 'after': 'key_loaded_callback' }, { 'trigger': 'reload', 'source': 'loaded', - 'dest': 'configuring' + 'dest': 'configuring', + 'after': 'key_loaded_callback' }, { 'trigger': 'run', @@ -171,6 +177,9 @@ class Key(ButtonBehavior, Widget): self.current_action.interrupt() # Callbacks + def key_loaded_callback(self): + self.parent.key_loaded_callback() + def callback_action_ready(self, action, success): if not success: self.fail() -- cgit v1.2.3