diff pidgin/gtksound.c @ 29695:b1284d63b969

propagate from branch 'im.pidgin.pidgin' (head 29f6b9d81574bfa9235dbd438a8934f06552e368) to branch 'im.pidgin.cpw.attention_ui' (head 382194d06f05cbf5030ec6471a719e32bf6ef9d7)
author Marcus Lundblad <ml@update.uu.se>
date Sun, 20 Sep 2009 19:57:21 +0000
parents 9c7fe51c153b 338d6a211055
children c783f9e66171
line wrap: on
line diff
--- a/pidgin/gtksound.c	Sun Sep 20 10:57:21 2009 +0000
+++ b/pidgin/gtksound.c	Sun Sep 20 19:57:21 2009 +0000
@@ -72,7 +72,9 @@
 	{N_("Others talk in chat"), "chat_msg_recv", "receive.wav"},
 	/* this isn't a terminator, it's the buddy pounce default sound event ;-) */
 	{NULL, "pounce_default", "alert.wav"},
-	{N_("Someone says your username in chat"), "nick_said", "alert.wav"}
+	{N_("Someone says your username in chat"), "nick_said", "alert.wav"},
+	{N_("Attention received"), "got_attention", "alert.wav"},
+	{N_("Attention sent"), "sent_attention", "alert.wav"}
 };
 
 static gboolean
@@ -219,6 +221,20 @@
 		play_conv_event(conv, event);
 }
 
+static void
+sent_attention_cb(PurpleAccount *account, const char *who, 
+	PurpleConversation *conv, guint type, PurpleSoundEventID event)
+{
+	play_conv_event(conv, event);
+}
+
+static void
+got_attention_cb(PurpleAccount *account, const char *who, 
+	PurpleConversation *conv, guint type, PurpleSoundEventID event)
+{
+	play_conv_event(conv, event);
+}
+
 /*
  * We mute sounds for the 10 seconds after you log in so that
  * you don't get flooded with sounds when the blist shows all
@@ -299,6 +315,10 @@
 	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/pounce_default", TRUE);
 	purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/pounce_default", "");
 	purple_prefs_add_string(PIDGIN_PREFS_ROOT "/sound/theme", "");
+	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/sent_attention", TRUE);
+	purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/sent_attention", "");
+	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/enabled/got_attention", TRUE);
+	purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/file/got_attention", "");
 	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/conv_focus", TRUE);
 	purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/sound/mute", FALSE);
 	purple_prefs_add_path(PIDGIN_PREFS_ROOT "/sound/command", "");
@@ -345,6 +365,12 @@
 	purple_signal_connect(conv_handle, "received-chat-msg",
 						gtk_sound_handle, PURPLE_CALLBACK(chat_msg_received_cb),
 						GINT_TO_POINTER(PURPLE_SOUND_CHAT_SAY));
+	purple_signal_connect(conv_handle, "sent-attention", gtk_sound_handle,
+						PURPLE_CALLBACK(sent_attention_cb),
+						  GINT_TO_POINTER(PURPLE_SOUND_SEND_ATTENTION));
+	purple_signal_connect(conv_handle, "got-attention", gtk_sound_handle,
+						PURPLE_CALLBACK(got_attention_cb),
+						  GINT_TO_POINTER(PURPLE_SOUND_GOT_ATTENTION));
 }
 
 static void