Mercurial > pidgin.yaz
comparison 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 |
comparison
equal
deleted
inserted
replaced
7560:af9968dbdc70 | 7561:cdfdbabd3266 |
---|---|
849 | 849 |
850 /* Ensure the window is visible. */ | 850 /* Ensure the window is visible. */ |
851 gaim_conv_window_show(win); | 851 gaim_conv_window_show(win); |
852 } | 852 } |
853 else { | 853 else { |
854 if (place_conv == NULL) | |
855 gaim_prefs_set_string("/core/conversations/placement", "last"); | |
856 | |
857 if (!place_conv) | 854 if (!place_conv) |
858 gaim_debug(GAIM_DEBUG_ERROR, "conversation", | 855 gaim_debug(GAIM_DEBUG_ERROR, "conversation", |
859 "This is about to suck.\n"); | 856 "This is about to suck.\n"); |
860 | 857 |
861 place_conv(conv); | 858 place_conv(conv); |
2479 return NULL; | 2476 return NULL; |
2480 | 2477 |
2481 return data->fnc; | 2478 return data->fnc; |
2482 } | 2479 } |
2483 | 2480 |
2484 static void | 2481 void |
2485 conv_placement_pref_cb(const char *name, GaimPrefType type, | 2482 gaim_conv_placement_set_current_func(GaimConvPlacementFunc func) |
2486 gpointer value, gpointer data) | 2483 { |
2487 { | 2484 g_return_if_fail(func != NULL); |
2488 GaimConvPlacementFunc fnc; | 2485 |
2489 | 2486 place_conv = func; |
2490 if (strcmp(name, "/core/conversations/placement")) | 2487 } |
2491 return; | 2488 |
2492 | 2489 GaimConvPlacementFunc |
2493 ensure_default_funcs(); | 2490 gaim_conv_placement_get_current_func(void) |
2494 | 2491 { |
2495 fnc = gaim_conv_placement_get_fnc(value); | 2492 return place_conv; |
2496 | |
2497 if (fnc == NULL) | |
2498 return; | |
2499 | |
2500 place_conv = fnc; | |
2501 } | 2493 } |
2502 | 2494 |
2503 static void | 2495 static void |
2504 update_titles_pref_cb(const char *name, GaimPrefType type, | 2496 update_titles_pref_cb(const char *name, GaimPrefType type, |
2505 gpointer value, gpointer data) | 2497 gpointer value, gpointer data) |
2506 { | 2498 { |
2507 /* | 2499 /* |
2508 * If the use_server_alias option was changed, and use_alias_for_title | 2500 * If the use_server_alias option was changed, and use_alias_for_title |
2509 * is false, then we don't have to do anything here. | 2501 * is false, then we don't have to do anything here. |
2510 */ | 2502 */ |
2511 if (!strcmp(name, "/core/buddies/use_server_alias") && | 2503 if (!strcmp(name, "/core/buddies/use_server_alias") && |
2512 !gaim_prefs_get_bool("/core/conversations/use_alias_for_title")) | 2504 !gaim_prefs_get_bool("/core/conversations/use_alias_for_title")) |
2513 return; | 2505 return; |
2514 | 2506 |
2515 gaim_conversation_foreach(gaim_conversation_autoset_title); | 2507 gaim_conversation_foreach(gaim_conversation_autoset_title); |
2516 } | 2508 } |
2548 gaim_prefs_add_none("/core/conversations"); | 2540 gaim_prefs_add_none("/core/conversations"); |
2549 gaim_prefs_add_bool("/core/conversations/send_urls_as_links", TRUE); | 2541 gaim_prefs_add_bool("/core/conversations/send_urls_as_links", TRUE); |
2550 gaim_prefs_add_bool("/core/conversations/away_back_on_send", TRUE); | 2542 gaim_prefs_add_bool("/core/conversations/away_back_on_send", TRUE); |
2551 gaim_prefs_add_bool("/core/conversations/use_alias_for_title", TRUE); | 2543 gaim_prefs_add_bool("/core/conversations/use_alias_for_title", TRUE); |
2552 gaim_prefs_add_bool("/core/conversations/combine_chat_im", FALSE); | 2544 gaim_prefs_add_bool("/core/conversations/combine_chat_im", FALSE); |
2553 gaim_prefs_add_string("/core/conversations/placement", "last"); | |
2554 | 2545 |
2555 /* Conversations -> Chat */ | 2546 /* Conversations -> Chat */ |
2556 gaim_prefs_add_none("/core/conversations/chat"); | 2547 gaim_prefs_add_none("/core/conversations/chat"); |
2557 gaim_prefs_add_bool("/core/conversations/chat/show_join", TRUE); | 2548 gaim_prefs_add_bool("/core/conversations/chat/show_join", TRUE); |
2558 gaim_prefs_add_bool("/core/conversations/chat/show_leave", TRUE); | 2549 gaim_prefs_add_bool("/core/conversations/chat/show_leave", TRUE); |
2561 /* Conversations -> IM */ | 2552 /* Conversations -> IM */ |
2562 gaim_prefs_add_none("/core/conversations/im"); | 2553 gaim_prefs_add_none("/core/conversations/im"); |
2563 gaim_prefs_add_bool("/core/conversations/im/show_login", TRUE); | 2554 gaim_prefs_add_bool("/core/conversations/im/show_login", TRUE); |
2564 gaim_prefs_add_bool("/core/conversations/im/send_typing", TRUE); | 2555 gaim_prefs_add_bool("/core/conversations/im/send_typing", TRUE); |
2565 | 2556 |
2566 gaim_prefs_connect_callback("/core/conversations/placement", | |
2567 conv_placement_pref_cb, NULL); | |
2568 gaim_prefs_trigger_callback("/core/conversations/placement"); | |
2569 gaim_prefs_connect_callback("/core/conversations/use_alias_for_title", | 2557 gaim_prefs_connect_callback("/core/conversations/use_alias_for_title", |
2570 update_titles_pref_cb, NULL); | 2558 update_titles_pref_cb, NULL); |
2571 gaim_prefs_connect_callback("/core/buddies/use_server_alias", | 2559 gaim_prefs_connect_callback("/core/buddies/use_server_alias", |
2572 update_titles_pref_cb, NULL); | 2560 update_titles_pref_cb, NULL); |
2573 | 2561 |