[Xfce4-commits] <postler:master> Play sound when there are new messages
Christian Dywan
noreply at xfce.org
Tue Nov 16 02:40:02 CET 2010
Updating branch refs/heads/master
to 1d6ba3c504fbd833b7b3147e33f91cbfc182da3c (commit)
from 33699ee2fac3bd6128010bec09e0de0d4f57d140 (commit)
commit 1d6ba3c504fbd833b7b3147e33f91cbfc182da3c
Author: Christian Dywan <christian at twotoasts.de>
Date: Tue Nov 16 02:38:24 2010 +0100
Play sound when there are new messages
postler/postler-folders.vala | 8 ++++++++
postler/wscript_build | 4 ++--
wscript | 1 +
3 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/postler/postler-folders.vala b/postler/postler-folders.vala
index 015e32d..4470125 100644
--- a/postler/postler-folders.vala
+++ b/postler/postler-folders.vala
@@ -78,6 +78,13 @@ public class Postler.Folders : Gtk.TreeView {
{ "Archive", STOCK_ARCHIVE, N_("Archive") }
};
+ static Canberra.Context sound_context = null;
+ void play_sound (string sound) {
+ if (sound_context == null)
+ Canberra.Context.create (out sound_context);
+ sound_context.play (0, Canberra.PROP_EVENT_ID, sound);
+ }
+
void unread_monitor_changed (File msg_dir, string path, string account) {
try {
var msg_enumerator = msg_dir.enumerate_children ("", 0, null);
@@ -95,6 +102,7 @@ public class Postler.Folders : Gtk.TreeView {
"You have %d new messages", unread).printf (unread),
STOCK_INTERNET_MAIL, null);
notification.show ();
+ play_sound ("message-new-email");
display_notify = false;
}
} catch (GLib.Error error) {
diff --git a/postler/wscript_build b/postler/wscript_build
index aa7b5cf..4e9051d 100644
--- a/postler/wscript_build
+++ b/postler/wscript_build
@@ -13,7 +13,7 @@ obj.name = 'postler'
obj.target = 'postler'
obj.includes = '. ..'
obj.find_sources_in_dirs ('.')
-obj.uselib = 'GIO GTHREAD GTK UNIQUE WEBKIT LIBNOTIFY'
-obj.packages = 'config postler posix gio-2.0 gtk+-2.0 libnotify unique-1.0 webkit-1.0'
+obj.uselib = 'GIO GTHREAD GTK LIBNOTIFY LIBCANBERRA UNIQUE WEBKIT'
+obj.packages = 'config postler posix gio-2.0 gtk+-2.0 libnotify libcanberra unique-1.0 webkit-1.0'
obj.vapi_dirs = '.'
diff --git a/wscript b/wscript
index 8a8ce5c..1866f0b 100644
--- a/wscript
+++ b/wscript
@@ -112,6 +112,7 @@ def configure (conf):
check_pkg ('gtk+-2.0', '2.12.0', var='GTK')
check_pkg ('webkit-1.0', '1.1.1')
check_pkg ('libnotify', var='LIBNOTIFY')
+ check_pkg ('libcanberra', var='LIBCANBERRA')
# isync
conf.check (header_name='sys/filio.h')
More information about the Xfce4-commits
mailing list