From: Christian H. <ch...@us...> - 2003-10-15 22:51:01
|
Update of /cvsroot/gaim/gaim/src In directory sc8-pr-cvs1:/tmp/cvs-serv7513/src Modified Files: gtkblist.c gtkpounce.c Log Message: Fixed a crash in the Add Chat dialog when selecting an account that doesn't support chats. Closes bug #821606. Index: gtkblist.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkblist.c,v retrieving revision 1.112 retrieving revision 1.113 diff -u -d -p -r1.112 -r1.113 --- gtkblist.c 14 Oct 2003 05:07:38 -0000 1.112 +++ gtkblist.c 15 Oct 2003 22:50:58 -0000 1.113 @@ -2889,6 +2889,8 @@ rebuild_addchat_entries(GaimGtkAddChatDa g_free(pce); } + g_list_free(list); + gtk_widget_show_all(data->entries_box); } @@ -2908,6 +2910,13 @@ add_chat_select_account_cb(GObject *w, G } } +static gboolean +add_chat_check_account_func(GaimAccount *account) +{ + GaimConnection *gc = gaim_account_get_connection(account); + + return (GAIM_PLUGIN_PROTOCOL_INFO(gc->prpl)->chat_info != NULL); +} void gaim_gtk_blist_request_add_chat(GaimAccount *account, GaimGroup *group) @@ -2997,7 +3006,8 @@ gaim_gtk_blist_request_add_chat(GaimAcco gtk_box_pack_start(GTK_BOX(rowbox), label, FALSE, FALSE, 0); data->account_menu = gaim_gtk_account_option_menu_new(account, FALSE, - G_CALLBACK(add_chat_select_account_cb), NULL, data); + G_CALLBACK(add_chat_select_account_cb), + add_chat_check_account_func, data); gtk_box_pack_start(GTK_BOX(rowbox), data->account_menu, TRUE, TRUE, 0); data->entries_box = gtk_vbox_new(FALSE, 5); Index: gtkpounce.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/gtkpounce.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -p -r1.38 -r1.39 --- gtkpounce.c 1 Oct 2003 04:05:46 -0000 1.38 +++ gtkpounce.c 15 Oct 2003 22:50:58 -0000 1.39 @@ -278,56 +278,6 @@ pounce_choose_cb(GtkWidget *item, GaimAc dialog->account = account; } -#if 0 -static GtkWidget * -pounce_user_menu(GaimGtkPounceDialog *dialog) -{ - GaimAccount *account; - GaimPlugin *prpl; - GtkWidget *opt_menu; - GtkWidget *menu; - GtkWidget *item; - GList *l; - char buf[2048]; - int count, place = 0; - - opt_menu = gtk_option_menu_new(); - menu = gtk_menu_new(); - - for (l = gaim_accounts_get_all(), count = 0; - l != NULL; - l = l->next, count++) { - - account = (GaimAccount *)l->data; - - prpl = gaim_find_prpl(account->protocol); - - g_snprintf(buf, sizeof(buf), "%s (%s)", account->username, - (prpl && prpl->info->name) - ? prpl->info->name : _("Unknown")); - - item = gtk_menu_item_new_with_label(buf); - g_object_set_data(G_OBJECT(item), "user_data", account); - - g_signal_connect(G_OBJECT(item), "activate", - G_CALLBACK(pounce_choose_cb), dialog); - - gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); - gtk_widget_show(item); - - if (dialog->account == account) { - gtk_menu_item_activate(GTK_MENU_ITEM(item)); - place = count; - } - } - - gtk_option_menu_set_menu(GTK_OPTION_MENU(opt_menu), menu); - gtk_option_menu_set_history(GTK_OPTION_MENU(opt_menu), place); - - return opt_menu; -} -#endif - static void buddy_changed_cb(GtkEntry *entry, GaimGtkPounceDialog *dialog) { @@ -896,8 +846,9 @@ pounce_cb(GaimPounce *pounce, GaimPounce memset(&StartInfo, 0 , sizeof(StartInfo)); StartInfo.cb = sizeof(StartInfo); CreateProcess(NULL, (char *)command, NULL, NULL, 0, 0, NULL, NULL, &StartInfo, &ProcInfo); - gaim_debug(GAIM_DEBUG_INFO, "pounce", "Pounce execute command called for: %s\n", command); - + gaim_debug_info("pounce", + "Pounce execute command called for: %s\n", + command); #endif } } |