summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKushal Das <kushal@fedoraproject.org>2008-10-02 02:12:53 +0530
committerKushal Das <kushal@fedoraproject.org>2008-10-02 02:12:53 +0530
commit175c2f133987f5adeef6988003b43e79ac384a01 (patch)
tree925b956aca4f162618d8f20ccc70bae806cf9f7b
parentbf676a97934b5bff930ebfb565076879bd3ef5cd (diff)
downloadjukebox-activity.git-175c2f133987f5adeef6988003b43e79ac384a01.zip
jukebox-activity.git-175c2f133987f5adeef6988003b43e79ac384a01.tar.gz
jukebox-activity.git-175c2f133987f5adeef6988003b43e79ac384a01.tar.xz
Back to play toolbar only, need to learn git revert fast
-rw-r--r--ControlToolbar.py21
-rw-r--r--MANIFEST1
-rwxr-xr-xjukeboxactivity.py44
3 files changed, 57 insertions, 9 deletions
diff --git a/ControlToolbar.py b/ControlToolbar.py
index 29a50f6..1069c72 100644
--- a/ControlToolbar.py
+++ b/ControlToolbar.py
@@ -31,6 +31,13 @@ from sugar.activity import activity
class ControlToolbar(gtk.Toolbar):
"""Class to create the Control (play )toolbar"""
+ __gsignals__ = {
+ 'go-fullscreen': (gobject.SIGNAL_RUN_FIRST,
+ gobject.TYPE_NONE,
+ ([]))
+ }
+
+
def __init__(self, toolbox, jukebox):
gtk.Toolbar.__init__(self)
self.toolbox = toolbox
@@ -77,6 +84,17 @@ class ControlToolbar(gtk.Toolbar):
self.audio_scale_item.add(self.audioscale)
self.insert(self.audio_scale_item, -1)
+ spacer = gtk.SeparatorToolItem()
+ spacer.props.draw = False
+ self.insert(spacer, -1)
+ spacer.show()
+ self._fullscreen = ToolButton('view-fullscreen')
+ self._fullscreen.set_tooltip(_('Fullscreen'))
+ self._fullscreen.connect('clicked', self._fullscreen_cb)
+ self.insert(self._fullscreen, -1)
+ self._fullscreen.show()
+
+
def _button_clicked_cb(self, widget):
self.jukebox.play_toggled()
@@ -90,3 +108,6 @@ class ControlToolbar(gtk.Toolbar):
self.button.set_sensitive(False)
self.scale_item.set_sensitive(False)
self.hscale.set_sensitive(False)
+
+ def _fullscreen_cb(self, button):
+ self.emit('go-fullscreen')
diff --git a/MANIFEST b/MANIFEST
index a62f73c..bf094f8 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -5,6 +5,5 @@ jukeboxactivity.py
icons/speaker.svg
activity/activity.info
activity/activity-jukebox.svg
-ViewToolbar.py
TODO
po/Jukebox.pot
diff --git a/jukeboxactivity.py b/jukeboxactivity.py
index ab791d2..0d6b909 100755
--- a/jukeboxactivity.py
+++ b/jukeboxactivity.py
@@ -43,7 +43,6 @@ import gtk
import urllib
from ControlToolbar import ControlToolbar
-from ViewToolbar import ViewToolbar
class JukeboxActivity(activity.Activity):
UPDATE_INTERVAL = 500
@@ -59,15 +58,9 @@ class JukeboxActivity(activity.Activity):
toolbox.add_toolbar(_('Play'), toolbar)
toolbar.show()
- self._view_toolbar = ViewToolbar(toolbox, self)
- toolbox.add_toolbar(_('View'), self._view_toolbar)
- self._view_toolbar.show()
-
-
-
toolbox.show()
- self._view_toolbar.connect('go-fullscreen', self.__go_fullscreen_cb)
+ self.toolbar.connect('go-fullscreen', self.__go_fullscreen_cb)
self.connect("shared", self._shared_cb)
@@ -431,3 +424,38 @@ class VideoWidget(gtk.DrawingArea):
self.imagesink = sink
self.imagesink.set_xwindow_id(self.window.xid)
+
+if __name__ == '__main__':
+ window = gtk.Window()
+
+ vadj = gtk.Adjustment()
+ hadj = gtk.Adjustment()
+ sw = gtk.ScrolledWindow(hadj, vadj)
+
+ view = VideoWidget()
+
+ #view.set_file_location(sys.argv[1])
+
+
+ sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
+
+
+ sw.add_with_viewport(view)
+ window.add(sw)
+ player = GstPlayer(view)
+ #player.connect("eos", self._player_eos_cb)
+ #player.connect("error", self._player_error_cb)
+ #player.connect("tag", self._player_new_tag_cb)
+ #player.connect("stream-info", self._player_stream_info_cb)
+
+ player.set_uri('file:///junk/pune.ogg')
+ player.play()
+ view.set_size_request(320,240)
+ window.set_size_request(1024,768)
+ #update(player)
+ window.show_all()
+
+ gobject.timeout_add(3000, update, player)
+
+ gtk.main()
+