From ecaae9887e03311f3b583bfb8e68efa2680260ff Mon Sep 17 00:00:00 2001 From: Florent Pigout Date: Thu, 22 Sep 2011 08:58:16 +0000 Subject: load graphics screen when create a new story [REVIEW] --- diff --git a/activity.py b/activity.py index 029b77f..0d3fdee 100644 --- a/activity.py +++ b/activity.py @@ -162,24 +162,24 @@ class AToiDeJouerActivity(activity.Activity): # sequence dict and list self.graphic_keys = StoryKeys('graphics', self) self.sound_keys = StoryKeys('sounds', self) - # current toolbar or screen index - _cur_tuple = (2, 'graphics') if len(self.graphic_keys._names) == 0\ - else (1, 'story') # show self._toolbox.show() # tmp var _toolbar = None + self.__story_toolbar = None # init toolbars for _n in ['story', 'graphics', 'graphics_add', 'sounds', 'sounds_add', 'help']: # init toolbar _t = toolbar.Toolbar(self, name=_n) # if default toolbar .. set default screen - if _n == _cur_tuple[1]: + if _n == 'story': + self.__story_toolbar = _t + elif _n == 'graphics': self._change_screen(_t) _toolbar = _t # set default tab - self._toolbox.set_current_toolbar(_cur_tuple[0]) + self._toolbox.set_current_toolbar(2) # .. self._toolbox.connect('current-toolbar-changed', _toolbar_changed, self) # do anim @@ -338,10 +338,9 @@ class AToiDeJouerActivity(activity.Activity): self.update_number_of_keys() # clear self.graphic_keys.ask_clear() - # refresh default - self._previous = self._current - _current = self.get_current_screen() - _current.refresh() + # switch to edit mode if no key + self._toolbox.set_current_toolbar(1) + self._change_screen(toolbar=self.__story_toolbar) def write_file(self, file_path): """Dummy overiding ... -- cgit v0.9.1