Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/jukeboxactivity.py
diff options
context:
space:
mode:
Diffstat (limited to 'jukeboxactivity.py')
-rw-r--r--jukeboxactivity.py68
1 files changed, 50 insertions, 18 deletions
diff --git a/jukeboxactivity.py b/jukeboxactivity.py
index fc20f2b..738caea 100644
--- a/jukeboxactivity.py
+++ b/jukeboxactivity.py
@@ -57,24 +57,57 @@ class JukeboxActivity(activity.Activity):
self._object_id = handle.object_id
self.set_title(_('Jukebox Activity'))
self.player = None
+ # we do not have collaboration features
+ # make the share option insensitive
+ self.max_participants = 1
- toolbox = activity.ActivityToolbox(self)
- self.set_toolbox(toolbox)
-
- self.toolbar = toolbar = ControlToolbar(toolbox, self)
- toolbox.add_toolbar(_('Play'), toolbar)
-
- toolbar.show()
- toolbox.show()
- self.toolbar.connect('go-fullscreen', self.__go_fullscreen_cb)
-
- self.toolbar.grab_focus()
- #self.connect("shared", self._shared_cb)
- activity_toolbar = toolbox.get_activity_toolbar()
- activity_toolbar.remove(activity_toolbar.share)
- activity_toolbar.share = None
- activity_toolbar.remove(activity_toolbar.keep)
- activity_toolbar.keep = None
+ try:
+ from sugar.graphics.toolbarbox import ToolbarBox, ToolbarButton
+ from sugar.activity.widgets import ActivityToolbarButton, StopButton, \
+ ShareButton, KeepButton
+ from mybutton import MyActivityToolbarButton
+
+ toolbar_box = ToolbarBox()
+ activity_button = MyActivityToolbarButton(self)
+ toolbar_box.toolbar.insert(activity_button, 0)
+ activity_button.show()
+
+ self.toolbar = toolbar = ControlToolbar(toolbar_box, self)
+ toolitem = gtk.ToolItem()
+ self.toolbar.bigbox.reparent(toolitem)
+ toolbar_box.toolbar.insert(toolitem, -1)
+ self.toolbar.bigbox.show()
+ toolitem.set_expand(True)
+ toolitem.show()
+
+ stop_button = StopButton(self)
+ stop_button.props.accelerator = '<Ctrl><Shift>Q'
+ toolbar_box.toolbar.insert(stop_button, -1)
+ stop_button.show()
+
+ toolbar_box.connect("key_press_event", self._key_press_event_cb)
+ self.set_toolbar_box(toolbar_box)
+ toolbar_box.show()
+ except ImportError:
+ toolbox = activity.ActivityToolbox(self)
+ self.set_toolbox(toolbox)
+
+ self.toolbar = toolbar = ControlToolbar(toolbox, self)
+ toolbox.add_toolbar(_('Play'), toolbar)
+
+ toolbar.show()
+ toolbox.show()
+ self.toolbar.connect('go-fullscreen', self.__go_fullscreen_cb)
+
+ self.toolbar.grab_focus()
+ #self.connect("shared", self._shared_cb)
+ activity_toolbar = toolbox.get_activity_toolbar()
+ activity_toolbar.remove(activity_toolbar.share)
+ activity_toolbar.share = None
+ activity_toolbar.remove(activity_toolbar.keep)
+ activity_toolbar.keep = None
+
+ self.toolbox.connect("key_press_event", self._key_press_event_cb)
if handle.uri:
pass
@@ -117,7 +150,6 @@ class JukeboxActivity(activity.Activity):
self.uri = handle.uri
gobject.idle_add(self._start, self.uri)
- self.toolbox.connect("key_press_event", self._key_press_event_cb)
def open_button_clicked_cb(self, widget):
""" To open the dialog to select a new file"""