#include <gdk/gdkkeysyms.h>
#include <glade/glade.h>
#include <glib/gi18n.h>
-#include <canberra-gtk.h>
#include <telepathy-glib/util.h>
#include <libmissioncontrol/mission-control.h>
sender = empathy_message_get_sender (message);
if (empathy_contact_is_user (sender) != FALSE) {
- if (empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_OUTGOING_MESSAGE)) {
- ca_gtk_play_for_widget (GTK_WIDGET (priv->dialog), 0,
- CA_PROP_EVENT_ID, "message-sent-instant",
- CA_PROP_EVENT_DESCRIPTION, _("Sent an instant message"),
- NULL);
- }
+ empathy_sound_play (GTK_WIDGET (priv->dialog),
+ EMPATHY_PREFS_SOUNDS_OUTGOING_MESSAGE,
+ "message-sent-instant", _("Sent an instant message"));
} else {
- if ((!has_focus || priv->current_chat != chat) &&
- empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_INCOMING_MESSAGE)) {
- ca_gtk_play_for_widget (GTK_WIDGET (priv->dialog), 0,
- CA_PROP_EVENT_ID, "message-new-instant",
- CA_PROP_EVENT_DESCRIPTION, _("Received an instant message"),
- NULL);
+ if ((!has_focus || priv->current_chat != chat)) {
+ empathy_sound_play (GTK_WIDGET (priv->dialog),
+ EMPATHY_PREFS_SOUNDS_INCOMING_MESSAGE,
+ "message-new-instant", _("Received an instant message"));
}
}
#include <gtk/gtk.h>
#include <glade/glade.h>
#include <glib/gi18n.h>
-#include <canberra-gtk.h>
#include <libempathy/empathy-contact.h>
#include <libempathy/empathy-utils.h>
static void
main_window_flash_start (EmpathyMainWindow *window)
{
- if (empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_NEW_CONVERSATION)) {
- ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
- CA_PROP_EVENT_ID, "message-new-instant",
- CA_PROP_EVENT_DESCRIPTION, _("Incoming chat request"),
- NULL);
- }
+ empathy_sound_play (GTK_WIDGET (window->window),
+ EMPATHY_PREFS_SOUNDS_NEW_CONVERSATION,
+ "message-new-instant", _("Incoming chat request"));
if (window->flash_timeout_id != 0) {
return;
main_window_error_display (window, account, message);
}
- if (current == TP_CONNECTION_STATUS_DISCONNECTED &&
- empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_SERVICE_LOGOUT)) {
- ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
- CA_PROP_EVENT_ID, "service-logout",
- CA_PROP_EVENT_DESCRIPTION, _("Disconnected from server"),
- NULL);
+ if (current == TP_CONNECTION_STATUS_DISCONNECTED) {
+ empathy_sound_play (GTK_WIDGET (window->window),
+ EMPATHY_PREFS_SOUNDS_SERVICE_LOGOUT,
+ "service-logout", _("Disconnected from server"));
}
if (current == TP_CONNECTION_STATUS_CONNECTED) {
GtkWidget *error_widget;
- if (empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_SERVICE_LOGIN)) {
- ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
- CA_PROP_EVENT_ID, "service-login",
- CA_PROP_EVENT_DESCRIPTION, _("Connected to server"),
- NULL);
- }
+ empathy_sound_play (GTK_WIDGET (window->window),
+ EMPATHY_PREFS_SOUNDS_SERVICE_LOGIN,
+ "service-login", _("Connected to server"));
/* Account connected without error, remove error message if any */
error_widget = g_hash_table_lookup (window->errors, account);
if (previous < MC_PRESENCE_AVAILABLE && current > MC_PRESENCE_OFFLINE) {
/* someone is logging in */
- if (empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_CONTACT_LOGIN)) {
- ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
- CA_PROP_EVENT_ID, "service-login",
- CA_PROP_EVENT_DESCRIPTION, _("Contact logged in"),
- NULL);
- }
+ empathy_sound_play (GTK_WIDGET (window->window),
+ EMPATHY_PREFS_SOUNDS_CONTACT_LOGIN,
+ "service-login", _("Contact logged in"));
return;
}
if (previous > MC_PRESENCE_OFFLINE && current < MC_PRESENCE_AVAILABLE) {
/* someone is logging off */
- if (empathy_sound_pref_is_enabled (EMPATHY_PREFS_SOUNDS_CONTACT_LOGOUT)) {
- ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
- CA_PROP_EVENT_ID, "service-logout",
- CA_PROP_EVENT_DESCRIPTION, _("Contact logged out"),
- NULL);
- }
+ empathy_sound_play (GTK_WIDGET (window->window),
+ EMPATHY_PREFS_SOUNDS_CONTACT_LOGOUT,
+ "service-logout", _("Contact logged out"));
}
}