diff src/gtkconv.c @ 9123:6ea36eac6f22

[gaim-migrate @ 9900] (12:38:12) Me: i did try to contact you before i reverted it the first time (12:38:28) seanegn: I know. I've been real unavailable of late. (12:39:51) Me: i'll tell you what i'm going to do then. i'm going to pull that, tag, and then put it back in after we get the tarballs made (12:39:57) Me: cause i do like the changes, just not the timing (12:42:16) seanegn: oh, of course. Everything I do is awesome. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sun, 30 May 2004 16:44:45 +0000
parents 2063f8de8f93
children 933a19e3a6b3
line wrap: on
line diff
--- a/src/gtkconv.c	Sun May 30 14:19:19 2004 +0000
+++ b/src/gtkconv.c	Sun May 30 16:44:45 2004 +0000
@@ -3387,7 +3387,7 @@
 	gaim_gtkconv_update_buttons_by_protocol(conv);
 
 	/* Check if the buttons should be visible or not */
-	button_type = gaim_prefs_get_int("/gaim/gtk/conversations/button_type");
+	button_type = gaim_prefs_get_int("/gaim/gtk/conversations/im/button_type");
 	if (button_type == GAIM_BUTTON_NONE)
 		gtk_widget_hide(gtkconv->bbox);
 	else
@@ -3474,7 +3474,7 @@
 	gaim_gtkconv_update_buttons_by_protocol(conv);
 
 	/* Check if the buttons should be visible or not */
-	button_type = gaim_prefs_get_int("/gaim/gtk/conversations/button_type");
+	button_type = gaim_prefs_get_int("/gaim/gtk/conversations/chat/button_type");
 	if (button_type == GAIM_BUTTON_NONE)
 		gtk_widget_hide(gtkconv->bbox);
 	else
@@ -4482,7 +4482,7 @@
 	g_object_get(G_OBJECT(gtkwin->window), "has-toplevel-focus", &has_focus, NULL);
 
 	if (!(flags & GAIM_MESSAGE_NO_LOG) &&
-		gaim_prefs_get_bool("/gaim/gtk/conversations/raise_on_events")) {
+		gaim_prefs_get_bool("/gaim/gtk/conversations/im/raise_on_events")) {
 
 		gaim_conv_window_raise(gaim_conversation_get_window(conv));
 	}
@@ -4546,8 +4546,7 @@
 
 	/* Raise the window, if specified in prefs. */
 	if (!(flags & GAIM_MESSAGE_NO_LOG) &&
-	    /* we may want to change this */
-		gaim_prefs_get_bool("/gaim/gtk/conversations/raise_on_events")) {
+		gaim_prefs_get_bool("/gaim/gtk/conversations/chat/raise_on_events")) {
 
 		gaim_conv_window_raise(gaim_conversation_get_window(conv));
 	}
@@ -4578,7 +4577,12 @@
 
 	win = gaim_conversation_get_window(conv);
 
-	if (!(flags & GAIM_MESSAGE_NO_LOG) && gaim_prefs_get_bool("/gaim/gtk/conversations/raise_on_events")) {
+	if (!(flags & GAIM_MESSAGE_NO_LOG) &&
+	    ((gaim_conversation_get_type(conv) == GAIM_CONV_CHAT &&
+	      gaim_prefs_get_bool("/gaim/gtk/conversations/chat/raise_on_events")) ||
+	     (gaim_conversation_get_type(conv) == GAIM_CONV_IM &&
+	      gaim_prefs_get_bool("/gaim/gtk/conversations/im/raise_on_events")))) {
+
 		gaim_conv_window_show(win);
 	}
 
@@ -5293,7 +5297,7 @@
 
 
 	vbox = gtk_vbox_new(FALSE, 0);
-	button_type = gaim_prefs_get_int("/gaim/gtk/conversations/button_type");
+	button_type = gaim_prefs_get_int("/gaim/gtk/conversations/im/button_type");
 	if(button_type == GAIM_BUTTON_NONE) {
 		gtk_box_pack_start(GTK_BOX(gtkconv->entrybox), vbox, FALSE, FALSE, 0);
 		gtk_box_reorder_child(GTK_BOX(gtkconv->entrybox), vbox, 0);
@@ -5686,27 +5690,19 @@
 }
 
 static void
-button_type_pref_cb(const char *name, GaimPrefType type,
+im_button_type_pref_cb(const char *name, GaimPrefType type,
 					   gpointer value, gpointer data)
 {
 	GList *l;
 	GaimConversation *conv;
 	GaimGtkConversation *gtkconv;
 
-	for (l = gaim_get_conversations(); l != NULL; l = l->next) {
+	for (l = gaim_get_ims(); l != NULL; l = l->next) {
 		conv = (GaimConversation *)l->data;
 		gtkconv = GAIM_GTK_CONVERSATION(conv);
-		switch (conv->type) {
-		case GAIM_CONV_IM:
-			setup_im_buttons(conv, gtk_widget_get_parent(gtkconv->send));
-			gaim_gtkconv_update_buddy_icon(conv);
-			break;
-		case GAIM_CONV_CHAT:
-			setup_chat_buttons(conv, gtk_widget_get_parent(gtkconv->send));
-			break;
-		default:
-			break;
-		}
+
+		setup_im_buttons(conv, gtk_widget_get_parent(gtkconv->send));
+		gaim_gtkconv_update_buddy_icon(conv);
 	}
 }
 
@@ -5752,6 +5748,22 @@
 }
 
 static void
+chat_button_type_pref_cb(const char *name, GaimPrefType type,
+						 gpointer value, gpointer data)
+{
+	GList *l;
+	GaimConversation *conv;
+	GaimGtkConversation *gtkconv;
+
+	for (l = gaim_get_chats(); l != NULL; l = l->next) {
+		conv = (GaimConversation *)l->data;
+		gtkconv = GAIM_GTK_CONVERSATION(conv);
+
+		setup_chat_buttons(conv, gtk_widget_get_parent(gtkconv->send));
+	}
+}
+
+static void
 conv_placement_pref_cb(const char *name, GaimPrefType type,
 					   gpointer value, gpointer data)
 {
@@ -5811,23 +5823,23 @@
 	gaim_prefs_add_int("/gaim/gtk/conversations/font_size", 3);
 	gaim_prefs_add_bool("/gaim/gtk/conversations/tabs", TRUE);
 	gaim_prefs_add_int("/gaim/gtk/conversations/tab_side", GTK_POS_TOP);
-	gaim_prefs_add_int("/gaim/gtk/conversations/button_type",
-					   GAIM_BUTTON_TEXT_IMAGE);
-	gaim_prefs_add_bool("/gaim/gtk/conversations/raise_on_events", FALSE);
-
 
 	/* Conversations -> Chat */
 	gaim_prefs_add_none("/gaim/gtk/conversations/chat");
+	gaim_prefs_add_int("/gaim/gtk/conversations/chat/button_type",
+					   GAIM_BUTTON_TEXT_IMAGE);
 	gaim_prefs_add_bool("/gaim/gtk/conversations/chat/color_nicks", TRUE);
+	gaim_prefs_add_bool("/gaim/gtk/conversations/chat/raise_on_events", FALSE);
 	gaim_prefs_add_int("/gaim/gtk/conversations/chat/default_width", 410);
 	gaim_prefs_add_int("/gaim/gtk/conversations/chat/default_height", 160);
 	gaim_prefs_add_int("/gaim/gtk/conversations/chat/entry_height", 50);
 
 	/* Conversations -> IM */
 	gaim_prefs_add_none("/gaim/gtk/conversations/im");
-
+	gaim_prefs_add_int("/gaim/gtk/conversations/im/button_type",
+					   GAIM_BUTTON_TEXT_IMAGE);
 	gaim_prefs_add_bool("/gaim/gtk/conversations/im/animate_buddy_icons", TRUE);
-
+	gaim_prefs_add_bool("/gaim/gtk/conversations/im/raise_on_events", FALSE);
 	gaim_prefs_add_bool("/gaim/gtk/conversations/im/show_buddy_icons", TRUE);
 	gaim_prefs_add_int("/gaim/gtk/conversations/im/default_width", 410);
 	gaim_prefs_add_int("/gaim/gtk/conversations/im/default_height", 160);
@@ -5855,16 +5867,21 @@
 			conv_placement_pref_cb, NULL);
 	gaim_prefs_trigger_callback("/gaim/gtk/conversations/placement");
 
-	gaim_prefs_connect_callback("/gaim/gtk/conversations/button_type",
-								button_type_pref_cb, NULL);
+
 
 	/* IM callbacks */
+	gaim_prefs_connect_callback("/gaim/gtk/conversations/im/button_type",
+								im_button_type_pref_cb, NULL);
 	gaim_prefs_connect_callback("/gaim/gtk/conversations/im/animate_buddy_icons",
 								animate_buddy_icons_pref_cb, NULL);
 	gaim_prefs_connect_callback("/gaim/gtk/conversations/im/show_buddy_icons",
 								show_buddy_icons_pref_cb, NULL);
 
 
+	/* Chat callbacks */
+	gaim_prefs_connect_callback("/gaim/gtk/conversations/chat/button_type",
+								chat_button_type_pref_cb, NULL);
+
 	/**********************************************************************
 	 * Register signals
 	 **********************************************************************/