Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/atoidepoc/ui/toolbar.py
diff options
context:
space:
mode:
Diffstat (limited to 'atoidepoc/ui/toolbar.py')
-rw-r--r--atoidepoc/ui/toolbar.py21
1 files changed, 17 insertions, 4 deletions
diff --git a/atoidepoc/ui/toolbar.py b/atoidepoc/ui/toolbar.py
index 9d063fc..5caf66f 100644
--- a/atoidepoc/ui/toolbar.py
+++ b/atoidepoc/ui/toolbar.py
@@ -10,7 +10,6 @@ import gtk
from sugar.graphics.toolbutton import ToolButton
# atoidepoc import
-from atoidepoc.storage import utils
from atoidepoc.ui import screens
# get application logger
@@ -48,9 +47,9 @@ BUTTONS = {
}
TOOLBARS = {
- 'graphic' : ['add'],
- 'sound' : ['add'],
- 'story' : ['open', 'play', ],
+ 'graphic' : ['add',],
+ 'sound' : ['add', 'play',],
+ 'story' : ['open', 'play',],
}
TITLES = {
@@ -64,6 +63,7 @@ TITLES = {
'toolbar': _('Sound'),
'buttons': {
'add': _('Add Sound'),
+ 'play': _('Play Sound'),
}
},
'story' : {
@@ -91,9 +91,22 @@ class Toolbar(gtk.Toolbar):
# add to parent
_toolbox = self.activity.get_toolbox()
_toolbox.add_toolbar(TITLES[self.name]['toolbar'], self)
+ # connect focus event
+ self.connect('focus', self._on_focus)
# show
self.show()
+ def _on_focus(self, widget, direction):
+ # screen factory
+ if self.name == 'graphic':
+ _cls = screens.ScreenPlayerGraphics
+ elif self.name == 'sound':
+ _cls = screens.ScreenPlayerSounds
+ elif self.name == 'story':
+ _cls = screens.ScreenStory
+ # do switch
+ _cls(self)
+
def _add_button(self, button_id):
# little check
if button_id in BUTTONS: