aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2009-01-07 00:46:01 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2009-01-07 00:46:01 +0800
commit77e83b7a443b00686d2c3791a644ceab4271935f (patch)
treef314e755a77fb598c2f5b635ebc5f1a1ba0b9dd6 /src
parent4260dd888fc8f4fc06851e01fcf65df44ccae352 (diff)
downloadgsoc2013-empathy-77e83b7a443b00686d2c3791a644ceab4271935f.tar
gsoc2013-empathy-77e83b7a443b00686d2c3791a644ceab4271935f.tar.gz
gsoc2013-empathy-77e83b7a443b00686d2c3791a644ceab4271935f.tar.bz2
gsoc2013-empathy-77e83b7a443b00686d2c3791a644ceab4271935f.tar.lz
gsoc2013-empathy-77e83b7a443b00686d2c3791a644ceab4271935f.tar.xz
gsoc2013-empathy-77e83b7a443b00686d2c3791a644ceab4271935f.tar.zst
gsoc2013-empathy-77e83b7a443b00686d2c3791a644ceab4271935f.zip
Adapt the libcanberra calls to use the new functions.
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@2025 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'src')
-rw-r--r--src/empathy-call-window.c3
-rw-r--r--src/empathy-chat-window.c28
-rw-r--r--src/empathy-main-window.c27
3 files changed, 31 insertions, 27 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index f8ccfc648..4c6777d62 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -198,7 +198,6 @@ call_window_hang_up_button_clicked_cb (GtkWidget *widget,
ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
CA_PROP_EVENT_ID, "phone-hangup",
CA_PROP_EVENT_DESCRIPTION, _("Voice call ended"),
- CA_PROP_APPLICATION_NAME, g_get_application_name (),
NULL);
DEBUG ("Call clicked, end call");
call_window_finalize (window);
@@ -407,7 +406,6 @@ call_window_update (EmpathyCallWindow *window)
ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
CA_PROP_EVENT_ID, "phone-incoming-call",
CA_PROP_EVENT_DESCRIPTION, _("Incoming voice call"),
- CA_PROP_APPLICATION_NAME, g_get_application_name (),
NULL);
}
else
@@ -415,7 +413,6 @@ call_window_update (EmpathyCallWindow *window)
ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
CA_PROP_EVENT_ID, "phone-outgoing-calling",
CA_PROP_EVENT_DESCRIPTION, _("Outgoing voice call"),
- CA_PROP_APPLICATION_NAME, g_get_application_name (),
NULL);
}
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index b5e30d647..e1bd9075e 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -842,30 +842,34 @@ chat_window_new_message_cb (EmpathyChat *chat,
EmpathyChatWindowPriv *priv;
gboolean has_focus;
gboolean needs_urgency;
- gboolean action_sounds_enabled;
EmpathyContact *sender;
priv = GET_PRIV (window);
has_focus = empathy_chat_window_has_focus (window);
- empathy_conf_get_bool (empathy_conf_get (),
- EMPATHY_PREFS_INPUT_FEEDBACK_SOUNDS,
- &action_sounds_enabled);
- /* always play sounds if enabled, otherwise only play if chat is not in focus */
- if (action_sounds_enabled || !has_focus || priv->current_chat != chat) {
- sender = empathy_message_get_sender(message);
- if (empathy_contact_is_user (sender) != FALSE) {
+ /* - if we're the sender, we play the sound if it's specified in the
+ * preferences and we're not away.
+ * - if we receive a message, we play the sound if it's specified in the
+ * prefereces and the window does not have focus on the chat receiving
+ * the message.
+ */
+
+ 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_ID, "message-sent-instant",
CA_PROP_EVENT_DESCRIPTION, _("Sent an instant message"),
- CA_PROP_APPLICATION_NAME, g_get_application_name (),
NULL);
- } else {
+ }
+ } 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"),
- CA_PROP_APPLICATION_NAME, g_get_application_name (),
NULL);
}
}
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 5c82fe599..ced1d68e3 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -286,11 +286,12 @@ main_window_flash_cb (EmpathyMainWindow *window)
static void
main_window_flash_start (EmpathyMainWindow *window)
{
- ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
- CA_PROP_EVENT_ID, "message-new-instant",
- CA_PROP_EVENT_DESCRIPTION, _("Incoming chat request"),
- CA_PROP_APPLICATION_NAME, g_get_application_name (),
- NULL);
+ 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);
+ }
if (window->flash_timeout_id != 0) {
return;
@@ -1172,22 +1173,24 @@ main_window_status_changed_cb (MissionControl *mc,
main_window_error_display (window, account, message);
}
- if (status == TP_CONNECTION_STATUS_DISCONNECTED) {
+ if (status == 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"),
- CA_PROP_APPLICATION_NAME, g_get_application_name (),
NULL);
}
if (status == TP_CONNECTION_STATUS_CONNECTED) {
GtkWidget *error_widget;
- ca_gtk_play_for_widget (GTK_WIDGET (window->window), 0,
- CA_PROP_EVENT_ID, "service-login",
- CA_PROP_EVENT_DESCRIPTION, _("Connected to server"),
- CA_PROP_APPLICATION_NAME, g_get_application_name (),
- NULL);
+ 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);
+ }
+
/* Account connected without error, remove error message if any */
error_widget = g_hash_table_lookup (window->errors, account);
if (error_widget) {