diff src/conversation.c @ 7561:cdfdbabd3266

[gaim-migrate @ 8175] Move conversation placement from a core pref to a UI pref. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Tue, 18 Nov 2003 23:24:05 +0000
parents 7d95978b07d9
children b859cfb5f31a
line wrap: on
line diff
--- a/src/conversation.c	Tue Nov 18 22:59:16 2003 +0000
+++ b/src/conversation.c	Tue Nov 18 23:24:05 2003 +0000
@@ -851,9 +851,6 @@
 		gaim_conv_window_show(win);
 	}
 	else {
-		if (place_conv == NULL)
-			gaim_prefs_set_string("/core/conversations/placement", "last");
-
 		if (!place_conv)
 			gaim_debug(GAIM_DEBUG_ERROR, "conversation",
 					   "This is about to suck.\n");
@@ -2481,23 +2478,18 @@
 	return data->fnc;
 }
 
-static void
-conv_placement_pref_cb(const char *name, GaimPrefType type,
-					   gpointer value, gpointer data)
+void
+gaim_conv_placement_set_current_func(GaimConvPlacementFunc func)
 {
-	GaimConvPlacementFunc fnc;
-
-	if (strcmp(name, "/core/conversations/placement"))
-		return;
-
-	ensure_default_funcs();
-
-	fnc = gaim_conv_placement_get_fnc(value);
-
-	if (fnc == NULL)
-		return;
-
-	place_conv = fnc;
+	g_return_if_fail(func != NULL);
+
+	place_conv = func;
+}
+
+GaimConvPlacementFunc
+gaim_conv_placement_get_current_func(void)
+{
+	return place_conv;
 }
 
 static void
@@ -2505,10 +2497,10 @@
 					  gpointer value, gpointer data)
 {
 	/*
-	 * If the use_server_alias option was changed, and use_alias_for_title 
+	 * If the use_server_alias option was changed, and use_alias_for_title
 	 * is false, then we don't have to do anything here.
 	 */
-	if (!strcmp(name, "/core/buddies/use_server_alias") && 
+	if (!strcmp(name, "/core/buddies/use_server_alias") &&
 		!gaim_prefs_get_bool("/core/conversations/use_alias_for_title"))
 		return;
 
@@ -2550,7 +2542,6 @@
 	gaim_prefs_add_bool("/core/conversations/away_back_on_send", TRUE);
 	gaim_prefs_add_bool("/core/conversations/use_alias_for_title", TRUE);
 	gaim_prefs_add_bool("/core/conversations/combine_chat_im", FALSE);
-	gaim_prefs_add_string("/core/conversations/placement", "last");
 
 	/* Conversations -> Chat */
 	gaim_prefs_add_none("/core/conversations/chat");
@@ -2563,9 +2554,6 @@
 	gaim_prefs_add_bool("/core/conversations/im/show_login", TRUE);
 	gaim_prefs_add_bool("/core/conversations/im/send_typing", TRUE);
 
-	gaim_prefs_connect_callback("/core/conversations/placement",
-			conv_placement_pref_cb, NULL);
-	gaim_prefs_trigger_callback("/core/conversations/placement");
 	gaim_prefs_connect_callback("/core/conversations/use_alias_for_title",
 			update_titles_pref_cb, NULL);
 	gaim_prefs_connect_callback("/core/buddies/use_server_alias",