aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c17
-rw-r--r--libempathy-gtk/empathy-ui-utils.h6
2 files changed, 21 insertions, 2 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
diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h
index 7c97f0943..285b66452 100644
--- a/libempathy-gtk/empathy-ui-utils.h
+++ b/libempathy-gtk/empathy-ui-utils.h
@@ -114,7 +114,11 @@ GtkWidget * empathy_link_button_new (const gchar *url,
void empathy_send_file_with_file_chooser (EmpathyContact *contact);
-gboolean empathy_sound_pref_is_enabled (const char *key);
+/* Sounds */
+void empathy_sound_play (GtkWidget *widget,
+ const char *key,
+ const char *event_id,
+ const char *description);
G_END_DECLS