Mercurial > pidgin.yaz
comparison src/conversation.c @ 9251:45d2ad4ac1c1
[gaim-migrate @ 10050]
Stu Tomlinson has provided a nice patch to move the separation of IM
and Chat windows back into the core from the extplacement plugin.
It's awesome to have crazy patch writers, and even better to have
crazy patch writers who write what I want to write before I do it,
thus saving me the effort.
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Wed, 09 Jun 2004 20:47:07 +0000 |
parents | 1e51236d825e |
children | 947876140943 |
comparison
equal
deleted
inserted
replaced
9250:ff8e380015e3 | 9251:45d2ad4ac1c1 |
---|---|
2228 static void | 2228 static void |
2229 conv_placement_last_created_win(GaimConversation *conv) | 2229 conv_placement_last_created_win(GaimConversation *conv) |
2230 { | 2230 { |
2231 GaimConvWindow *win; | 2231 GaimConvWindow *win; |
2232 | 2232 |
2233 #if 0 /* Last-minute prefslash */ | 2233 win = g_list_last(gaim_get_windows())->data; |
2234 if (gaim_prefs_get_bool("/core/conversations/combine_chat_im")) | 2234 |
2235 win = g_list_last(gaim_get_windows())->data; | 2235 if (win == NULL) { |
2236 win = gaim_conv_window_new(); | |
2237 | |
2238 gaim_conv_window_add_conversation(win, conv); | |
2239 gaim_conv_window_show(win); | |
2240 } | |
2236 else | 2241 else |
2237 win = gaim_get_last_window_with_type(gaim_conversation_get_type(conv)); | 2242 gaim_conv_window_add_conversation(win, conv); |
2238 #else | 2243 } |
2239 win = g_list_last(gaim_get_windows())->data; | 2244 |
2240 #endif | 2245 /* This one places conversations in the last made window of the same type. */ |
2246 static void | |
2247 conv_placement_last_created_win_type(GaimConversation *conv) | |
2248 { | |
2249 GaimConvWindow *win; | |
2250 | |
2251 win = gaim_get_last_window_with_type(gaim_conversation_get_type(conv)); | |
2241 | 2252 |
2242 if (win == NULL) { | 2253 if (win == NULL) { |
2243 win = gaim_conv_window_new(); | 2254 win = gaim_conv_window_new(); |
2244 | 2255 |
2245 gaim_conv_window_add_conversation(win, conv); | 2256 gaim_conv_window_add_conversation(win, conv); |
2373 | 2384 |
2374 /* Make a new window. */ | 2385 /* Make a new window. */ |
2375 conv_placement_new_window(conv); | 2386 conv_placement_new_window(conv); |
2376 } | 2387 } |
2377 | 2388 |
2378 #if 0 /* PREFSLASH04 */ | |
2379 | |
2380 static void | |
2381 conv_placement_by_number(GaimConversation *conv) | |
2382 { | |
2383 GaimConvWindow *win = NULL; | |
2384 | |
2385 if (gaim_prefs_get_bool("/core/conversations/combine_chat_im")) | |
2386 win = g_list_last(gaim_get_windows())->data; | |
2387 else | |
2388 win = gaim_get_last_window_with_type(gaim_conversation_get_type(conv)); | |
2389 | |
2390 if (win == NULL) { | |
2391 win = gaim_conv_window_new(); | |
2392 | |
2393 gaim_conv_window_add_conversation(win, conv); | |
2394 gaim_conv_window_show(win); | |
2395 } else { | |
2396 int max_count = gaim_prefs_get_int("/gaim/gtk/conversations/placement_number"); | |
2397 int count = gaim_conv_window_get_conversation_count(win); | |
2398 | |
2399 if (count < max_count) | |
2400 gaim_conv_window_add_conversation(win, conv); | |
2401 else { | |
2402 GList *l = NULL; | |
2403 | |
2404 for (l = gaim_get_windows(); l != NULL; l = l->next) { | |
2405 win = (GaimConvWindow *)l->data; | |
2406 | |
2407 count = gaim_conv_window_get_conversation_count(win); | |
2408 if (count < max_count) { | |
2409 gaim_conv_window_add_conversation(win, conv); | |
2410 return; | |
2411 } | |
2412 } | |
2413 win = gaim_conv_window_new(); | |
2414 | |
2415 gaim_conv_window_add_conversation(win, conv); | |
2416 gaim_conv_window_show(win); | |
2417 } | |
2418 } | |
2419 } | |
2420 | |
2421 #endif | |
2422 | |
2423 static ConvPlacementData * | 2389 static ConvPlacementData * |
2424 get_conv_placement_data(const char *id) | 2390 get_conv_placement_data(const char *id) |
2425 { | 2391 { |
2426 ConvPlacementData *data = NULL; | 2392 ConvPlacementData *data = NULL; |
2427 GList *n; | 2393 GList *n; |
2455 { | 2421 { |
2456 if (conv_placement_fncs == NULL) | 2422 if (conv_placement_fncs == NULL) |
2457 { | 2423 { |
2458 add_conv_placement_fnc("last", _("Last created window"), | 2424 add_conv_placement_fnc("last", _("Last created window"), |
2459 conv_placement_last_created_win); | 2425 conv_placement_last_created_win); |
2426 add_conv_placement_fnc("im_chat", _("Separate IM and Chat windows"), | |
2427 conv_placement_last_created_win_type); | |
2460 add_conv_placement_fnc("new", _("New window"), | 2428 add_conv_placement_fnc("new", _("New window"), |
2461 conv_placement_new_window); | 2429 conv_placement_new_window); |
2462 add_conv_placement_fnc("group", _("By group"), | 2430 add_conv_placement_fnc("group", _("By group"), |
2463 conv_placement_by_group); | 2431 conv_placement_by_group); |
2464 add_conv_placement_fnc("account", _("By account"), | 2432 add_conv_placement_fnc("account", _("By account"), |
2601 **********************************************************************/ | 2569 **********************************************************************/ |
2602 | 2570 |
2603 /* Conversations */ | 2571 /* Conversations */ |
2604 gaim_prefs_add_none("/core/conversations"); | 2572 gaim_prefs_add_none("/core/conversations"); |
2605 gaim_prefs_add_bool("/core/conversations/use_alias_for_title", TRUE); | 2573 gaim_prefs_add_bool("/core/conversations/use_alias_for_title", TRUE); |
2606 gaim_prefs_add_bool("/core/conversations/combine_chat_im", FALSE); | |
2607 | 2574 |
2608 /* Conversations -> Chat */ | 2575 /* Conversations -> Chat */ |
2609 gaim_prefs_add_none("/core/conversations/chat"); | 2576 gaim_prefs_add_none("/core/conversations/chat"); |
2610 gaim_prefs_add_bool("/core/conversations/chat/show_nick_change", TRUE); | 2577 gaim_prefs_add_bool("/core/conversations/chat/show_nick_change", TRUE); |
2611 | 2578 |