diff options
author | florent <florent.pigout@gmail.com> | 2011-04-19 11:24:57 (GMT) |
---|---|---|
committer | florent <florent.pigout@gmail.com> | 2011-04-19 11:24:57 (GMT) |
commit | 3d71e892ce7a21fb2bd154d247135b698a1e3a66 (patch) | |
tree | 92565ad97f1a62a3f40b19ffaf5fc0336882cb5a | |
parent | 04cc663f9c61691cb47e9c409857c0dc25ac6762 (diff) |
update number of keys when loading activity and importing project
-rw-r--r-- | activity.py | 6 | ||||
-rw-r--r-- | atoidejouer/tools/storage.py | 6 | ||||
-rw-r--r-- | atoidejouer/ui/timeline.py | 5 |
3 files changed, 15 insertions, 2 deletions
diff --git a/activity.py b/activity.py index d2921d6..c2ac1bc 100644 --- a/activity.py +++ b/activity.py @@ -286,6 +286,12 @@ class AToiDeJouerActivity(activity.Activity): # parse json data self.graphic_keys.loads(_data) self.sound_keys.loads(_data) + # set max + _graphic_max = self.graphic_keys.get_max_frame() + _sound_max = self.sound_keys.get_max_frame() + _max = _graphic_max if _graphic_max > _sound_max else _sound_max + # set activity new number of keys + self.set_number_of_keys(_max + 1) # refresh default _current = self.get_current_screen() _current.refresh() diff --git a/atoidejouer/tools/storage.py b/atoidejouer/tools/storage.py index 47d6719..63f5e36 100644 --- a/atoidejouer/tools/storage.py +++ b/atoidejouer/tools/storage.py @@ -285,6 +285,12 @@ def __import_keys(activity_, project_name): # parse json data _exist_graphic_keys = activity_.graphic_keys.loads(_data, clear=False) _exist_sound_keys = activity_.sound_keys.loads(_data, clear=False) + # set max + _graphic_max = activity_.graphic_keys.get_max_frame() + _sound_max = activity_.sound_keys.get_max_frame() + _max = _graphic_max if _graphic_max > _sound_max else _sound_max + # set activity new number of keys + activity_.set_number_of_keys(_max + 1) # .. return { 'graphics': _exist_graphic_keys, diff --git a/atoidejouer/ui/timeline.py b/atoidejouer/ui/timeline.py index 6a77515..04513ad 100644 --- a/atoidejouer/ui/timeline.py +++ b/atoidejouer/ui/timeline.py @@ -307,12 +307,13 @@ class Timeline(gtk.Frame): # ... for _i, _r in enumerate(_t_children): # title row | row - eventbox - button - label - _label = _r.get_children()[0].get_children()[0].get_children()[0] + _label_wid = _r.get_children()[0].get_children()[0].get_children()[0] + _label_str = _label_wid.get_label() # ... for _frame, _c_key in enumerate(_k_children[_i].get_children()[0]): # ... _current, _f_type, _k_type = self.story_keys.get_current( - _label.get_label(), _frame) + _label_str, _frame) # get button _button = _c_key.get_children()[0] # ... |