Mercurial > pidgin.yaz
comparison finch/gntblist.c @ 23395:7076f4e965c5
merge of '34ebad1a339cefdab142795e0b3a045ad7016658'
and '868098fbe53290a8abcc3307c6fec2c6054a5e00'
author | Casey Harkins <charkins@pidgin.im> |
---|---|
date | Fri, 27 Jun 2008 00:01:59 +0000 |
parents | 6d4e4a5963f3 |
children | e7d85f4fb3fc |
comparison
equal
deleted
inserted
replaced
22898:5d833ca5a265 | 23395:7076f4e965c5 |
---|---|
2720 PurpleAccount *account; | 2720 PurpleAccount *account; |
2721 const char *name; | 2721 const char *name; |
2722 PurpleConnection *gc; | 2722 PurpleConnection *gc; |
2723 PurpleChat *chat; | 2723 PurpleChat *chat; |
2724 GHashTable *hash = NULL; | 2724 GHashTable *hash = NULL; |
2725 PurpleConversation *conv; | |
2725 | 2726 |
2726 account = purple_request_fields_get_account(fields, "account"); | 2727 account = purple_request_fields_get_account(fields, "account"); |
2727 name = purple_request_fields_get_string(fields, "chat"); | 2728 name = purple_request_fields_get_string(fields, "chat"); |
2728 | 2729 |
2729 if (!purple_account_is_connected(account)) | 2730 if (!purple_account_is_connected(account)) |
2730 return; | 2731 return; |
2731 | 2732 |
2732 gc = purple_account_get_connection(account); | 2733 gc = purple_account_get_connection(account); |
2733 purple_conversation_new(PURPLE_CONV_TYPE_CHAT, account, name); | 2734 /* Create a new conversation now. This will give focus to the new window. |
2735 * But it's necessary to pretend that we left the chat, because otherwise | |
2736 * a new conversation window will pop up when we finally join the chat. */ | |
2737 if (!(conv = purple_find_conversation_with_account(PURPLE_CONV_TYPE_CHAT, name, account))) { | |
2738 conv = purple_conversation_new(PURPLE_CONV_TYPE_CHAT, account, name); | |
2739 purple_conv_chat_left(PURPLE_CONV_CHAT(conv)); | |
2740 } else { | |
2741 purple_conversation_present(conv); | |
2742 } | |
2743 | |
2734 chat = purple_blist_find_chat(account, name); | 2744 chat = purple_blist_find_chat(account, name); |
2735 if (chat == NULL) { | 2745 if (chat == NULL) { |
2736 PurplePluginProtocolInfo *info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); | 2746 PurplePluginProtocolInfo *info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc)); |
2737 if (info->chat_info_defaults != NULL) | 2747 if (info->chat_info_defaults != NULL) |
2738 hash = info->chat_info_defaults(gc, name); | 2748 hash = info->chat_info_defaults(gc, name); |
2839 NULL, NULL, NULL, | 2849 NULL, NULL, NULL, |
2840 NULL); | 2850 NULL); |
2841 } | 2851 } |
2842 | 2852 |
2843 static void | 2853 static void |
2854 view_all_logs_cb(GntMenuItem *item, gpointer n) | |
2855 { | |
2856 finch_log_show(PURPLE_LOG_IM, NULL, NULL); | |
2857 } | |
2858 | |
2859 static void | |
2844 menu_add_buddy_cb(GntMenuItem *item, gpointer null) | 2860 menu_add_buddy_cb(GntMenuItem *item, gpointer null) |
2845 { | 2861 { |
2846 purple_blist_request_add_buddy(NULL, NULL, NULL, NULL); | 2862 purple_blist_request_add_buddy(NULL, NULL, NULL, NULL); |
2847 } | 2863 } |
2848 | 2864 |
2902 | 2918 |
2903 item = gnt_menuitem_new(_("View Log...")); | 2919 item = gnt_menuitem_new(_("View Log...")); |
2904 gnt_menuitem_set_id(GNT_MENU_ITEM(item), "view-log"); | 2920 gnt_menuitem_set_id(GNT_MENU_ITEM(item), "view-log"); |
2905 gnt_menu_add_item(GNT_MENU(sub), item); | 2921 gnt_menu_add_item(GNT_MENU(sub), item); |
2906 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), view_log_cb, NULL); | 2922 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), view_log_cb, NULL); |
2923 | |
2924 item = gnt_menuitem_new(_("View All Logs")); | |
2925 gnt_menuitem_set_id(GNT_MENU_ITEM(item), "view-all-logs"); | |
2926 gnt_menu_add_item(GNT_MENU(sub), item); | |
2927 gnt_menuitem_set_callback(GNT_MENU_ITEM(item), view_all_logs_cb, NULL); | |
2907 | 2928 |
2908 item = gnt_menuitem_new(_("Show")); | 2929 item = gnt_menuitem_new(_("Show")); |
2909 gnt_menu_add_item(GNT_MENU(sub), item); | 2930 gnt_menu_add_item(GNT_MENU(sub), item); |
2910 subsub = gnt_menu_new(GNT_MENU_POPUP); | 2931 subsub = gnt_menu_new(GNT_MENU_POPUP); |
2911 gnt_menuitem_set_submenu(item, GNT_MENU(subsub)); | 2932 gnt_menuitem_set_submenu(item, GNT_MENU(subsub)); |
3009 GNT_WIDGET_SET_FLAGS(ggblist->tree, GNT_WIDGET_NO_BORDER); | 3030 GNT_WIDGET_SET_FLAGS(ggblist->tree, GNT_WIDGET_NO_BORDER); |
3010 gnt_widget_set_size(ggblist->tree, purple_prefs_get_int(PREF_ROOT "/size/width"), | 3031 gnt_widget_set_size(ggblist->tree, purple_prefs_get_int(PREF_ROOT "/size/width"), |
3011 purple_prefs_get_int(PREF_ROOT "/size/height")); | 3032 purple_prefs_get_int(PREF_ROOT "/size/height")); |
3012 gnt_widget_set_position(ggblist->window, purple_prefs_get_int(PREF_ROOT "/position/x"), | 3033 gnt_widget_set_position(ggblist->window, purple_prefs_get_int(PREF_ROOT "/position/x"), |
3013 purple_prefs_get_int(PREF_ROOT "/position/y")); | 3034 purple_prefs_get_int(PREF_ROOT "/position/y")); |
3014 | |
3015 gnt_tree_set_col_width(GNT_TREE(ggblist->tree), 0, | |
3016 purple_prefs_get_int(PREF_ROOT "/size/width") - 1); | |
3017 | 3035 |
3018 gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->tree); | 3036 gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->tree); |
3019 | 3037 |
3020 ggblist->status = gnt_combo_box_new(); | 3038 ggblist->status = gnt_combo_box_new(); |
3021 gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->status); | 3039 gnt_box_add_widget(GNT_BOX(ggblist->window), ggblist->status); |