changeset 14188:a01a34238815

[gaim-migrate @ 16852] Our very own Nathan Walp wrote this patch to allow people to make their chat windows do the flashy-flashy thing. committer: Tailor Script <tailor@pidgin.im>
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 18 Aug 2006 22:59:12 +0000
parents 95a4542e92d4
children 789d80a6b9d9
files plugins/win32/winprefs/winprefs.c
diffstat 1 files changed, 31 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/win32/winprefs/winprefs.c	Fri Aug 18 22:41:44 2006 +0000
+++ b/plugins/win32/winprefs/winprefs.c	Fri Aug 18 22:59:12 2006 +0000
@@ -52,6 +52,7 @@
 static const char *PREF_DBLIST_SIDE = "/plugins/gtk/win32/winprefs/dblist_side";
 static const char *PREF_BLIST_ON_TOP = "/plugins/gtk/win32/winprefs/blist_on_top";
 static const char *PREF_IM_BLINK = "/plugins/gtk/win32/winprefs/im_blink";
+static const char *PREF_CHAT_BLINK = "/plugins/gtk/win32/winprefs/chat_blink";
 
 /* Deprecated */
 static const char *PREF_DBLIST_ON_TOP = "/plugins/gtk/win32/winprefs/dblist_on_top";
@@ -317,8 +318,7 @@
 /* FlashWindowEx is only supported by Win98+ and WinNT5+. If it's
    not supported we do it our own way */
 static gboolean
-wgaim_conv_im_blink(GaimAccount *account, const char *who, char **message,
-		GaimConversation *conv, int flags, void *data)
+wgaim_conv_blink(GaimConversation *conv, int flags)
 {
 	GaimGtkWindow *win;
 	GtkWidget *window;
@@ -327,9 +327,6 @@
 	if(flags & GAIM_MESSAGE_SEND || flags & GAIM_MESSAGE_SYSTEM)
 		return FALSE;
 
-	if(!gaim_prefs_get_bool(PREF_IM_BLINK))
-		return FALSE;
-
 	if(conv == NULL) {
 		gaim_debug_info("winprefs", "gar!\n");
 		return FALSE;
@@ -368,6 +365,27 @@
 	return FALSE;
 }
 
+static gboolean
+wgaim_conv_im_blink(GaimAccount *account, const char *who, char **message,
+		GaimConversation *conv, int flags, void *data)
+{
+	if(!gaim_prefs_get_bool(PREF_IM_BLINK))
+		return FALSE;
+
+	return wgaim_conv_blink(conv, flags);
+
+}
+
+static gboolean
+wgaim_conv_chat_blink(GaimAccount *account, const char *who, char **message,
+		GaimConversation *conv, int flags, void *data)
+{
+	if(!gaim_prefs_get_bool(PREF_CHAT_BLINK))
+		return FALSE;
+
+	return wgaim_conv_blink(conv, flags);
+}
+
 
 /*
  *  EXPORTED FUNCTIONS
@@ -394,6 +412,10 @@
 		"displaying-im-msg", plugin, GAIM_CALLBACK(wgaim_conv_im_blink),
 		NULL);
 
+	gaim_signal_connect(gaim_gtk_conversations_get_handle(),
+		"displaying-chat-msg", plugin, GAIM_CALLBACK(wgaim_conv_chat_blink),
+		NULL);
+
 	gaim_signal_connect((void*)gaim_get_core(), "quitting", plugin,
 		GAIM_CALLBACK(gaim_quit_cb), NULL);
 
@@ -467,8 +489,10 @@
 
 	/* Conversations */
 	vbox = gaim_gtk_make_frame(ret, _("Conversations"));
-	gaim_gtk_prefs_checkbox(_("_Flash window when messages are received"),
+	gaim_gtk_prefs_checkbox(_("_Flash window when IMs are received"),
 							PREF_IM_BLINK, vbox);
+	gaim_gtk_prefs_checkbox(_("_Flash window when chat messages are received"),
+							PREF_CHAT_BLINK, vbox);
 
 	gtk_widget_show_all(ret);
 	return ret;
@@ -517,6 +541,7 @@
 	gaim_prefs_add_int(PREF_DBLIST_HEIGHT, 0);
 	gaim_prefs_add_int(PREF_DBLIST_SIDE, 0);
 	gaim_prefs_add_bool(PREF_IM_BLINK, TRUE);
+	gaim_prefs_add_bool(PREF_CHAT_BLINK, FALSE);
 
 	/* Convert old preferences */
 	if(gaim_prefs_exists(PREF_DBLIST_ON_TOP)) {