Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/sugar-shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-09-22 12:49:21 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-09-22 12:49:21 (GMT)
commit9ffcbfca4d6f5e8b4f67569e38583956c58660be (patch)
tree763699ab242b1abe30f558af7bd00f2d3d265b88 /shell/sugar-shell
parentd8a5fed0e006a540da6f5e5baeb39328e3ad650b (diff)
Play a startup sound if it exists.
Diffstat (limited to 'shell/sugar-shell')
-rwxr-xr-xshell/sugar-shell13
1 files changed, 10 insertions, 3 deletions
diff --git a/shell/sugar-shell b/shell/sugar-shell
index a054189..93f2faa 100755
--- a/shell/sugar-shell
+++ b/shell/sugar-shell
@@ -24,6 +24,7 @@ import pygtk
pygtk.require('2.0')
import gtk
import gobject
+import gst
from sugar import logger
from sugar import env
@@ -82,13 +83,19 @@ def check_cm(bus_name):
pass
return False
-def _unfreeze_dcon_idle_cb():
- # Unfreeze the display when it's stable
+def _shell_started_cb():
+ # Unfreeze the display
hw_manager = hardwaremanager.get_manager()
hw_manager.set_dcon_freeze(0)
+ startup_sound = os.path.join(env.get_sounds_path('startup.ogg'))
+ if os.path.exists(startup_sound):
+ player = gst.element_factory_make("playbin", "player")
+ player.set_property("uri", "file://" + startup_sound)
+ player.set_state(gst.STATE_PLAYING)
+
def main():
- gobject.idle_add(_unfreeze_dcon_idle_cb)
+ gobject.idle_add(_shell_started_cb)
_save_session_info()
_start_matchbox()