[gnome-clocks] Use the sound theme defined in gsettings



commit a466c5e2138360e73e898573b7493eb03103d50e
Author: Paolo Borelli <pborelli gnome org>
Date:   Wed Dec 5 10:26:50 2012 +0100

    Use the sound theme defined in gsettings

 gnomeclocks/utils.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/gnomeclocks/utils.py b/gnomeclocks/utils.py
index c366f02..9e86865 100644
--- a/gnomeclocks/utils.py
+++ b/gnomeclocks/utils.py
@@ -170,6 +170,8 @@ class WallClock(GObject.GObject):
 
 
 class Alert:
+    settings = Gio.Settings.new('org.gnome.desktop.sound')
+
     def __init__(self, soundid, msg):
         try:
             self.canberra = pycanberra.Canberra()
@@ -177,6 +179,7 @@ class Alert:
             print "Sound will not be available: ", e
             self.canberra = None
 
+        self.soundtheme = Alert.settings.get_string('theme-name')
         self.soundid = soundid
 
         self.notification = None
@@ -189,6 +192,7 @@ class Alert:
         if self.canberra:
             self.canberra.play(1,
                                pycanberra.CA_PROP_EVENT_ID, self.soundid,
+                               pycanberra.CA_PROP_CANBERRA_XDG_THEME_NAME, self.soundtheme,
                                pycanberra.CA_PROP_MEDIA_ROLE, "alarm",
                                None)
         if self.notification:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]