aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-ui-utils.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2009-01-07 00:48:49 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2009-01-07 00:48:49 +0800
commit65f7803dd86bdb99814cbabda7dfb9e9116d86f1 (patch)
tree98290f786ba1bbfbf183e663051b5c4002163f87 /libempathy-gtk/empathy-ui-utils.c
parentaef8f7c5f413cd7830d01476be8d36c2f485a828 (diff)
downloadgsoc2013-empathy-65f7803dd86bdb99814cbabda7dfb9e9116d86f1.tar
gsoc2013-empathy-65f7803dd86bdb99814cbabda7dfb9e9116d86f1.tar.gz
gsoc2013-empathy-65f7803dd86bdb99814cbabda7dfb9e9116d86f1.tar.bz2
gsoc2013-empathy-65f7803dd86bdb99814cbabda7dfb9e9116d86f1.tar.lz
gsoc2013-empathy-65f7803dd86bdb99814cbabda7dfb9e9116d86f1.tar.xz
gsoc2013-empathy-65f7803dd86bdb99814cbabda7dfb9e9116d86f1.tar.zst
gsoc2013-empathy-65f7803dd86bdb99814cbabda7dfb9e9116d86f1.zip
Turn empathy_sound_pref_is_enabled into empathy_sound_play that
automatically plays the sound if the pref is enabled. svn path=/trunk/; revision=2078
Diffstat (limited to 'libempathy-gtk/empathy-ui-utils.c')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index da658dac6..f937ce110 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -38,6 +38,7 @@
#include <gtk/gtk.h>
#include <gio/gio.h>
#include <glade/glade.h>
+#include <canberra-gtk.h>
#include <libmissioncontrol/mc-profile.h>
@@ -1492,7 +1493,7 @@ empathy_send_file_with_file_chooser (EmpathyContact *contact)
gtk_widget_show (widget);
}
-gboolean
+static gboolean
empathy_sound_pref_is_enabled (const char *key)
{
EmpathyConf *conf;
@@ -1526,3 +1527,17 @@ empathy_sound_pref_is_enabled (const char *key)
return res;
}
+
+void
+empathy_sound_play (GtkWidget *widget,
+ const char *key,
+ const char *event_id,
+ const char *description)
+{
+ if (empathy_sound_pref_is_enabled (key)) {
+ ca_gtk_play_for_widget (widget, 0,
+ CA_PROP_EVENT_ID, event_id,
+ CA_PROP_EVENT_DESCRIPTION, description,
+ NULL);
+ }
+} \ No newline at end of file