From 36465cbbcefbf8f242b41bc6e957ee4337b1edea Mon Sep 17 00:00:00 2001 From: Florent Pigout Date: Fri, 14 Oct 2011 09:50:05 +0000 Subject: remove old keys from activity module --- diff --git a/activity.py b/activity.py index 0d3fdee..e0099bf 100644 --- a/activity.py +++ b/activity.py @@ -18,8 +18,6 @@ from sugar.activity import activity from atoidejouer.ui import screens, toolbar # .. from atoidejouer.tools import config, storage -# .. -from atoidejouer.story.keys import StoryKeys # get application logger logger = logging.getLogger('atoidejouer') @@ -159,31 +157,21 @@ class AToiDeJouerActivity(activity.Activity): self._number_of_keys = 1 # .. self.__splash = None - # sequence dict and list - self.graphic_keys = StoryKeys('graphics', self) - self.sound_keys = StoryKeys('sounds', self) # 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']: + for _n in ['story', 'edit', 'help']: # init toolbar - _t = toolbar.Toolbar(self, name=_n) - # if default toolbar .. set default screen - if _n == 'story': - self.__story_toolbar = _t - elif _n == 'graphics': - self._change_screen(_t) - _toolbar = _t - # set default tab - self._toolbox.set_current_toolbar(2) - # .. + toolbar.Toolbar(self, name=_n) + # set toolbox cb self._toolbox.connect('current-toolbar-changed', _toolbar_changed, self) # do anim self._thread = ThreadAnim(self) + # show the activity screen + self._change_screen(toolbar=None, name='activity') def get_toolbox(self): return self._toolbox @@ -248,7 +236,7 @@ class AToiDeJouerActivity(activity.Activity): self._previous = self._current self._current = toolbar.name if name is None else name # already exist - if self._current in ['graphics', 'sounds']: + if self._current == 'edit': if self.__splash is None: self.__splash = screens.Splash(toolbar) else: @@ -271,8 +259,7 @@ class AToiDeJouerActivity(activity.Activity): toolbar.pause() # update all self._thread.set_time() - if self._current == 'graphics'\ - or self._current == 'sounds': + if self._current == 'edit': # .. refresh self._screens[self._current].timeline.refresh_sequence() self._screens[self._current].timeline.refresh_adjustment() @@ -291,22 +278,14 @@ class AToiDeJouerActivity(activity.Activity): # .. return # screen factory - elif self._current == 'graphics': - _scr = screens.ScreenEditGraphics(toolbar) + elif self._current == 'edit': + _scr = screens.ScreenEdit(toolbar) # .. init sequences for _n in self.graphic_keys._names: _scr.timeline.add_sequence(_n) # .. refresh _scr.timeline.refresh_sequence() _scr.timeline.refresh_adjustment() - elif self._current == 'sounds': - _scr = screens.ScreenEditSounds(toolbar) - # .. init sequences - for _n in self.sound_keys._names: - _scr.timeline.add_sequence(_n) - # .. refresh - _scr.timeline.refresh_sequence() - _scr.timeline.refresh_adjustment() elif self._current == 'story': _scr = screens.ScreenStory(toolbar, set_canvas=True) elif self._current == 'help': -- cgit v0.9.1