comparison src/dialogs.c @ 4491:3196d9044a45

[gaim-migrate @ 4766] aim_user is dead. long live gaim_account. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 31 Jan 2003 13:03:47 +0000
parents 62c1e5e656d0
children c7986b4d182a
comparison
equal deleted inserted replaced
4490:70b892694e0b 4491:3196d9044a45
134 GtkWidget *save; 134 GtkWidget *save;
135 GtkWidget *menu; 135 GtkWidget *menu;
136 GtkWidget *sound; 136 GtkWidget *sound;
137 GtkWidget *soundentry; 137 GtkWidget *soundentry;
138 138
139 struct aim_user *user; 139 struct gaim_account *account;
140 struct buddy_pounce *buddy_pounce; 140 struct buddy_pounce *buddy_pounce;
141 }; 141 };
142 142
143 struct findbyemail { 143 struct findbyemail {
144 GtkWidget *window; 144 GtkWidget *window;
193 } 193 }
194 194
195 struct set_info_dlg { 195 struct set_info_dlg {
196 GtkWidget *window; 196 GtkWidget *window;
197 GtkWidget *menu; 197 GtkWidget *menu;
198 struct aim_user *user; 198 struct gaim_account *account;
199 GtkWidget *text; 199 GtkWidget *text;
200 GtkWidget *save; 200 GtkWidget *save;
201 GtkWidget *cancel; 201 GtkWidget *cancel;
202 }; 202 };
203 203
204 struct set_icon_dlg { 204 struct set_icon_dlg {
205 GtkWidget *window; 205 GtkWidget *window;
206 struct aim_user *user; 206 struct gaim_account *account;
207 GtkWidget *ok; 207 GtkWidget *ok;
208 GtkWidget *cancel; 208 GtkWidget *cancel;
209 GtkWidget *entry; 209 GtkWidget *entry;
210 }; 210 };
211 211
458 return; 458 return;
459 459
460 g = find_group_by_buddy(b); 460 g = find_group_by_buddy(b);
461 461
462 debug_printf(_("Removing '%s' from buddy list.\n"), b->name); 462 debug_printf(_("Removing '%s' from buddy list.\n"), b->name);
463 serv_remove_buddy(b->user->gc, name, g->name); 463 serv_remove_buddy(b->account->gc, name, g->name);
464 remove_buddy(b); 464 remove_buddy(b);
465 gaim_blist_save(); 465 gaim_blist_save();
466 466
467 c = gaim_find_conversation(name); 467 c = gaim_find_conversation(name);
468 468
472 g_free(name); 472 g_free(name);
473 } 473 }
474 474
475 void show_confirm_del(struct gaim_connection *gc, gchar *name) 475 void show_confirm_del(struct gaim_connection *gc, gchar *name)
476 { 476 {
477 struct buddy *bd = find_buddy(gc->user, name); 477 struct buddy *bd = find_buddy(gc->account, name);
478 char *text; 478 char *text;
479 if (!bd) 479 if (!bd)
480 return; 480 return;
481 481
482 text = g_strdup_printf(_("You are about to remove %s from your buddy list. Do you want to continue?"), name); 482 text = g_strdup_printf(_("You are about to remove %s from your buddy list. Do you want to continue?"), name);
559 559
560 static void do_im(GtkWidget *widget, int resp, struct getuserinfo *info) 560 static void do_im(GtkWidget *widget, int resp, struct getuserinfo *info)
561 { 561 {
562 const char *who; 562 const char *who;
563 struct gaim_conversation *conv; 563 struct gaim_conversation *conv;
564 struct aim_user *user; 564 struct gaim_account *account;
565 565
566 if (resp == GTK_RESPONSE_OK) { 566 if (resp == GTK_RESPONSE_OK) {
567 who = gtk_entry_get_text(GTK_ENTRY(info->entry)); 567 who = gtk_entry_get_text(GTK_ENTRY(info->entry));
568 568
569 if (!g_strcasecmp(who, "")) { 569 if (!g_strcasecmp(who, "")) {
570 g_free(info); 570 g_free(info);
571 return; 571 return;
572 } 572 }
573 573
574 user = (info->gc ? info->gc->user : NULL); 574 account = (info->gc ? info->gc->account : NULL);
575 575
576 conv = gaim_find_conversation(who); 576 conv = gaim_find_conversation(who);
577 577
578 if (conv == NULL) 578 if (conv == NULL)
579 conv = gaim_conversation_new(GAIM_CONV_IM, user, who); 579 conv = gaim_conversation_new(GAIM_CONV_IM, account, who);
580 else { 580 else {
581 gaim_window_raise(gaim_conversation_get_window(conv)); 581 gaim_window_raise(gaim_conversation_get_window(conv));
582 582
583 if (user) 583 if (account)
584 gaim_conversation_set_user(conv, info->gc->user); 584 gaim_conversation_set_account(conv, account);
585 } 585 }
586 } 586 }
587 587
588 destroy_dialog(NULL, imdialog); 588 destroy_dialog(NULL, imdialog);
589 imdialog = NULL; 589 imdialog = NULL;
888 grp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry)); 888 grp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry));
889 whoalias = gtk_entry_get_text(GTK_ENTRY(a->entry_for_alias)); 889 whoalias = gtk_entry_get_text(GTK_ENTRY(a->entry_for_alias));
890 890
891 c = gaim_find_conversation(who); 891 c = gaim_find_conversation(who);
892 892
893 add_buddy(a->gc->user, grp, who, whoalias); 893 add_buddy(a->gc->account, grp, who, whoalias);
894 serv_add_buddy(a->gc, who); 894 serv_add_buddy(a->gc, who);
895 895
896 if (c != NULL) 896 if (c != NULL)
897 gaim_conversation_update(c, GAIM_CONV_UPDATE_ADD); 897 gaim_conversation_update(c, GAIM_CONV_UPDATE_ADD);
898 898
1179 static void set_deny_mode(GtkWidget *w, int data) 1179 static void set_deny_mode(GtkWidget *w, int data)
1180 { 1180 {
1181 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w))) 1181 if (!gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w)))
1182 return; 1182 return;
1183 debug_printf("setting deny mode %d\n", data); 1183 debug_printf("setting deny mode %d\n", data);
1184 current_deny_gc->user->permdeny = data; 1184 current_deny_gc->account->permdeny = data;
1185 serv_set_permit_deny(current_deny_gc); 1185 serv_set_permit_deny(current_deny_gc);
1186 gaim_blist_save(); 1186 gaim_blist_save();
1187 } 1187 }
1188 1188
1189 static GtkWidget *deny_opt(char *label, int which, GtkWidget *set) 1189 static GtkWidget *deny_opt(char *label, int which, GtkWidget *set)
1197 gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(set)), 1197 gtk_radio_button_new_with_label(gtk_radio_button_group(GTK_RADIO_BUTTON(set)),
1198 label); 1198 label);
1199 1199
1200 g_signal_connect(GTK_OBJECT(opt), "toggled", G_CALLBACK(set_deny_mode), (void *)which); 1200 g_signal_connect(GTK_OBJECT(opt), "toggled", G_CALLBACK(set_deny_mode), (void *)which);
1201 gtk_widget_show(opt); 1201 gtk_widget_show(opt);
1202 if (current_deny_gc->user->permdeny == which) 1202 if (current_deny_gc->account->permdeny == which)
1203 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE); 1203 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(opt), TRUE);
1204 1204
1205 return opt; 1205 return opt;
1206 } 1206 }
1207 1207
1222 1222
1223 static void set_deny_type() 1223 static void set_deny_type()
1224 { 1224 {
1225 GSList *bg = gtk_radio_button_group(GTK_RADIO_BUTTON(deny_type)); 1225 GSList *bg = gtk_radio_button_group(GTK_RADIO_BUTTON(deny_type));
1226 1226
1227 switch (current_deny_gc->user->permdeny) { 1227 switch (current_deny_gc->account->permdeny) {
1228 case 5: 1228 case 5:
1229 bg = bg->next->next; 1229 bg = bg->next->next;
1230 break; 1230 break;
1231 case 4: 1231 case 4:
1232 break; 1232 break;
1251 GtkTreeIter iter; 1251 GtkTreeIter iter;
1252 1252
1253 if (!current_is_deny) 1253 if (!current_is_deny)
1254 return; 1254 return;
1255 1255
1256 p = current_deny_gc->user->permit; 1256 p = current_deny_gc->account->permit;
1257 1257
1258 gtk_list_store_clear(GTK_LIST_STORE(allow_store)); 1258 gtk_list_store_clear(GTK_LIST_STORE(allow_store));
1259 1259
1260 while (p) { 1260 while (p) {
1261 ls = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(allow_list))); 1261 ls = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(allow_list)));
1275 GtkTreeIter iter; 1275 GtkTreeIter iter;
1276 1276
1277 if (!current_is_deny) 1277 if (!current_is_deny)
1278 return; 1278 return;
1279 1279
1280 d = current_deny_gc->user->deny; 1280 d = current_deny_gc->account->deny;
1281 1281
1282 gtk_list_store_clear(GTK_LIST_STORE(block_store)); 1282 gtk_list_store_clear(GTK_LIST_STORE(block_store));
1283 1283
1284 while (d) { 1284 while (d) {
1285 ls = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(block_list))); 1285 ls = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(block_list)));
1393 1393
1394 if (!permit && !block_list) 1394 if (!permit && !block_list)
1395 return; 1395 return;
1396 1396
1397 if (permit) { 1397 if (permit) {
1398 char *name = find_permdeny_by_name(current_deny_gc->user->permit, who); 1398 char *name = find_permdeny_by_name(current_deny_gc->account->permit, who);
1399 1399
1400 if (name) { 1400 if (name) {
1401 gaim_privacy_permit_remove(current_deny_gc->user, name); 1401 gaim_privacy_permit_remove(current_deny_gc->account, name);
1402 serv_rem_permit(current_deny_gc, who); 1402 serv_rem_permit(current_deny_gc, who);
1403 build_allow_list(); 1403 build_allow_list();
1404 } 1404 }
1405 } else { 1405 } else {
1406 char *name = find_permdeny_by_name(current_deny_gc->user->deny, who); 1406 char *name = find_permdeny_by_name(current_deny_gc->account->deny, who);
1407 1407
1408 if (name) { 1408 if (name) {
1409 gaim_privacy_deny_remove(current_deny_gc->user, name); 1409 gaim_privacy_deny_remove(current_deny_gc->account, name);
1410 serv_rem_deny(current_deny_gc, who); 1410 serv_rem_deny(current_deny_gc, who);
1411 build_block_list(); 1411 build_block_list();
1412 } 1412 }
1413 } 1413 }
1414 1414
1635 1635
1636 g_snprintf(bp->name, 80, "%s", gtk_entry_get_text(GTK_ENTRY(b->nameentry))); 1636 g_snprintf(bp->name, 80, "%s", gtk_entry_get_text(GTK_ENTRY(b->nameentry)));
1637 g_snprintf(bp->message, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->messentry))); 1637 g_snprintf(bp->message, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->messentry)));
1638 g_snprintf(bp->command, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->commentry))); 1638 g_snprintf(bp->command, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->commentry)));
1639 g_snprintf(bp->sound, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->soundentry))); 1639 g_snprintf(bp->sound, 2048, "%s", gtk_entry_get_text(GTK_ENTRY(b->soundentry)));
1640 g_snprintf(bp->pouncer, 80, "%s", b->user->username); 1640 g_snprintf(bp->pouncer, 80, "%s", b->account->username);
1641 1641
1642 bp->protocol = b->user->protocol; 1642 bp->protocol = b->account->protocol;
1643 1643
1644 bp->options = 0; 1644 bp->options = 0;
1645 1645
1646 if (GTK_TOGGLE_BUTTON(b->popupnotify)->active) 1646 if (GTK_TOGGLE_BUTTON(b->popupnotify)->active)
1647 bp->options |= OPT_POUNCE_NOTIFY; 1647 bp->options |= OPT_POUNCE_NOTIFY;
1684 g_free(b); 1684 g_free(b);
1685 } 1685 }
1686 1686
1687 static void pounce_choose(GtkWidget *opt, struct addbp *b) 1687 static void pounce_choose(GtkWidget *opt, struct addbp *b)
1688 { 1688 {
1689 struct aim_user *u = gtk_object_get_user_data(GTK_OBJECT(opt)); 1689 struct gaim_account *account = gtk_object_get_user_data(GTK_OBJECT(opt));
1690 b->user = u; 1690 b->account = account;
1691 } 1691 }
1692 1692
1693 static GtkWidget *pounce_user_menu(struct addbp *b, struct gaim_connection *gc) 1693 static GtkWidget *pounce_user_menu(struct addbp *b, struct gaim_connection *gc)
1694 { 1694 {
1695 GtkWidget *optmenu; 1695 GtkWidget *optmenu;
1696 GtkWidget *menu; 1696 GtkWidget *menu;
1697 GtkWidget *opt; 1697 GtkWidget *opt;
1698 GSList *u = aim_users; 1698 GSList *u = gaim_accounts;
1699 struct aim_user *a; 1699 struct gaim_account *account;
1700 struct prpl *p; 1700 struct prpl *p;
1701 int count = 0; 1701 int count = 0;
1702 int place = 0; 1702 int place = 0;
1703 char buf[2048]; 1703 char buf[2048];
1704 1704
1706 optmenu = gtk_option_menu_new(); 1706 optmenu = gtk_option_menu_new();
1707 1707
1708 menu = gtk_menu_new(); 1708 menu = gtk_menu_new();
1709 1709
1710 while (u) { 1710 while (u) {
1711 a = (struct aim_user *)u->data; 1711 account = (struct gaim_account *)u->data;
1712 p = (struct prpl *)find_prpl(a->protocol); 1712 p = (struct prpl *)find_prpl(account->protocol);
1713 g_snprintf(buf, sizeof buf, "%s (%s)", a->username, (p && p->name)?p->name:_("Unknown")); 1713 g_snprintf(buf, sizeof buf, "%s (%s)", account->username, (p && p->name)?p->name:_("Unknown"));
1714 opt = gtk_menu_item_new_with_label(buf); 1714 opt = gtk_menu_item_new_with_label(buf);
1715 gtk_object_set_user_data(GTK_OBJECT(opt), a); 1715 gtk_object_set_user_data(GTK_OBJECT(opt), account);
1716 g_signal_connect(GTK_OBJECT(opt), "activate", G_CALLBACK(pounce_choose), b); 1716 g_signal_connect(GTK_OBJECT(opt), "activate", G_CALLBACK(pounce_choose), b);
1717 gtk_menu_append(GTK_MENU(menu), opt); 1717 gtk_menu_append(GTK_MENU(menu), opt);
1718 gtk_widget_show(opt); 1718 gtk_widget_show(opt);
1719 1719
1720 if (b->user == a) { 1720 if (b->account == account) {
1721 gtk_menu_item_activate(GTK_MENU_ITEM(opt)); 1721 gtk_menu_item_activate(GTK_MENU_ITEM(opt));
1722 place = count; 1722 place = count;
1723 } 1723 }
1724 1724
1725 count++; 1725 count++;
1726 1726
1727 u = u->next; 1727 u = u->next;
1728 } 1728 }
1729 1729
1730 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu); 1730 gtk_option_menu_set_menu(GTK_OPTION_MENU(optmenu), menu);
1731 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), place); 1731 gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu), place);
1750 1750
1751 struct addbp *b = g_new0(struct addbp, 1); 1751 struct addbp *b = g_new0(struct addbp, 1);
1752 1752
1753 if(edit_bp) { 1753 if(edit_bp) {
1754 b->buddy_pounce = edit_bp; 1754 b->buddy_pounce = edit_bp;
1755 b->user = find_user(edit_bp->pouncer, edit_bp->protocol); 1755 b->account = gaim_account_find(edit_bp->pouncer, edit_bp->protocol);
1756 } else { 1756 } else {
1757 b->user = gc ? gc->user : aim_users->data; 1757 b->account = gc ? gc->account : gaim_accounts->data;
1758 b->buddy_pounce = NULL; 1758 b->buddy_pounce = NULL;
1759 } 1759 }
1760 1760
1761 GAIM_DIALOG(b->window); 1761 GAIM_DIALOG(b->window);
1762 dialogwindows = g_list_prepend(dialogwindows, b->window); 1762 dialogwindows = g_list_prepend(dialogwindows, b->window);
2000 gchar *junk; 2000 gchar *junk;
2001 struct gaim_connection *gc; 2001 struct gaim_connection *gc;
2002 2002
2003 junk = gtk_text_view_get_text(GTK_TEXT_VIEW(b->text), FALSE); 2003 junk = gtk_text_view_get_text(GTK_TEXT_VIEW(b->text), FALSE);
2004 2004
2005 if (b->user) { 2005 if (b->account) {
2006 strncpy_withhtml(b->user->user_info, junk, sizeof b->user->user_info); 2006 strncpy_withhtml(b->account->user_info, junk, sizeof b->account->user_info);
2007 gc = b->user->gc; 2007 gc = b->account->gc;
2008 2008
2009 save_prefs(); 2009 save_prefs();
2010 2010
2011 if (gc) 2011 if (gc)
2012 serv_set_info(gc, b->user->user_info); 2012 serv_set_info(gc, b->account->user_info);
2013 } 2013 }
2014 g_free(junk); 2014 g_free(junk);
2015 destroy_dialog(NULL, b->window); 2015 destroy_dialog(NULL, b->window);
2016 g_free(b); 2016 g_free(b);
2017 } 2017 }
2322 GtkWidget *label; 2322 GtkWidget *label;
2323 GtkWidget *vbox; 2323 GtkWidget *vbox;
2324 GtkTextBuffer *buffer; 2324 GtkTextBuffer *buffer;
2325 GtkWidget *frame; 2325 GtkWidget *frame;
2326 gchar *buf; 2326 gchar *buf;
2327 struct aim_user *tmp; 2327 struct gaim_account *account;
2328 2328
2329 struct set_info_dlg *b = g_new0(struct set_info_dlg, 1); 2329 struct set_info_dlg *b = g_new0(struct set_info_dlg, 1);
2330 tmp = gc->user; 2330 account = gc->account;
2331 b->user = tmp; 2331 b->account = account;
2332 2332
2333 GAIM_DIALOG(b->window); 2333 GAIM_DIALOG(b->window);
2334 gtk_window_set_role(GTK_WINDOW(b->window), "set_info"); 2334 gtk_window_set_role(GTK_WINDOW(b->window), "set_info");
2335 dialogwindows = g_list_prepend(dialogwindows, b->window); 2335 dialogwindows = g_list_prepend(dialogwindows, b->window);
2336 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set User Info")); 2336 gtk_window_set_title(GTK_WINDOW(b->window), _("Gaim - Set User Info"));
2341 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5); 2341 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2342 gtk_container_add(GTK_CONTAINER(b->window), vbox); 2342 gtk_container_add(GTK_CONTAINER(b->window), vbox);
2343 gtk_widget_show(vbox); 2343 gtk_widget_show(vbox);
2344 2344
2345 buf = g_malloc(256); 2345 buf = g_malloc(256);
2346 g_snprintf(buf, 256, _("Changing info for %s:"), tmp->username); 2346 g_snprintf(buf, 256, _("Changing info for %s:"), account->username);
2347 label = gtk_label_new(buf); 2347 label = gtk_label_new(buf);
2348 g_free(buf); 2348 g_free(buf);
2349 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); 2349 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
2350 gtk_widget_show(label); 2350 gtk_widget_show(label);
2351 2351
2352 frame = gtk_frame_new(NULL); 2352 frame = gtk_frame_new(NULL);
2353 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); 2353 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN);
2354 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); 2354 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
2355 gtk_widget_show(frame); 2355 gtk_widget_show(frame);
2356 2356
2357 b->text = gtk_text_view_new(); 2357 b->text = gtk_text_view_new();
2358 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(b->text), GTK_WRAP_WORD); 2358 gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(b->text), GTK_WRAP_WORD);
2359 gtk_widget_set_size_request(b->text, 300, 200); 2359 gtk_widget_set_size_request(b->text, 300, 200);
2360 buf = g_malloc(strlen(tmp->user_info) + 1); 2360 buf = g_malloc(strlen(account->user_info) + 1);
2361 strncpy_nohtml(buf, tmp->user_info, strlen(tmp->user_info) + 1); 2361 strncpy_nohtml(buf, account->user_info, strlen(account->user_info) + 1);
2362 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(b->text)); 2362 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(b->text));
2363 gtk_text_buffer_set_text(buffer, buf, -1); 2363 gtk_text_buffer_set_text(buffer, buf, -1);
2364 g_free(buf); 2364 g_free(buf);
2365 gtk_container_add(GTK_CONTAINER(frame), b->text); 2365 gtk_container_add(GTK_CONTAINER(frame), b->text);
2366 gtk_widget_show(b->text); 2366 gtk_widget_show(b->text);
2486 const char *who; 2486 const char *who;
2487 2487
2488 who = gtk_entry_get_text(GTK_ENTRY(p->entry)); 2488 who = gtk_entry_get_text(GTK_ENTRY(p->entry));
2489 2489
2490 if (!p->permit) { 2490 if (!p->permit) {
2491 if (gaim_privacy_deny_add(p->gc->user, who)) { 2491 if (gaim_privacy_deny_add(p->gc->account, who)) {
2492 serv_add_deny(p->gc, who); 2492 serv_add_deny(p->gc, who);
2493 build_block_list(); 2493 build_block_list();
2494 gaim_blist_save(); 2494 gaim_blist_save();
2495 } 2495 }
2496 } else { 2496 } else {
2497 if (gaim_privacy_permit_add(p->gc->user, who)) { 2497 if (gaim_privacy_permit_add(p->gc->account, who)) {
2498 serv_add_permit(p->gc, who); 2498 serv_add_permit(p->gc, who);
2499 build_allow_list(); 2499 build_allow_list();
2500 gaim_blist_save(); 2500 gaim_blist_save();
2501 } 2501 }
2502 } 2502 }
3397 const char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog)); 3397 const char *file = gtk_file_selection_get_filename(GTK_FILE_SELECTION(importdialog));
3398 if (file_is_dir(file, importdialog)) { 3398 if (file_is_dir(file, importdialog)) {
3399 return; 3399 return;
3400 } 3400 }
3401 if (g_slist_find(connections, importgc)) { 3401 if (g_slist_find(connections, importgc)) {
3402 do_import(importgc->user, file); 3402 do_import(importgc->account, file);
3403 gaim_blist_save(); 3403 gaim_blist_save();
3404 } 3404 }
3405 destroy_dialog(NULL, importdialog); 3405 destroy_dialog(NULL, importdialog);
3406 } 3406 }
3407 3407
4367 handle_group_rename(orig, g->name); 4367 handle_group_rename(orig, g->name);
4368 groups = g_slist_remove(groups, g); 4368 groups = g_slist_remove(groups, g);
4369 /* FIXME, i don't like calling this. it's sloppy. */ build_edit_tree(); 4369 /* FIXME, i don't like calling this. it's sloppy. */ build_edit_tree();
4370 accts = gaim_group_get_accounts(g); 4370 accts = gaim_group_get_accounts(g);
4371 while(accts) { 4371 while(accts) {
4372 struct aim_user *au = accts->data; 4372 struct gaim_account *account = accts->data;
4373 serv_rename_group(au->gc, g, new_name); 4373 serv_rename_group(account->gc, g, new_name);
4374 accts = g_slist_remove(accts, accts->data); 4374 accts = g_slist_remove(accts, accts->data);
4375 } 4375 }
4376 g_free(g); 4376 g_free(g);
4377 } else { 4377 } else {
4378 prevname = g_strdup(g->name); 4378 prevname = g_strdup(g->name);
4379 accts = gaim_group_get_accounts(g); 4379 accts = gaim_group_get_accounts(g);
4380 while(accts) { 4380 while(accts) {
4381 struct aim_user *au = accts->data; 4381 struct gaim_account *account = accts->data;
4382 serv_rename_group(au->gc, g, new_name); 4382 serv_rename_group(account->gc, g, new_name);
4383 accts = g_slist_remove(accts, accts->data); 4383 accts = g_slist_remove(accts, accts->data);
4384 } 4384 }
4385 g_snprintf(g->name, sizeof(g->name), "%s", new_name); 4385 g_snprintf(g->name, sizeof(g->name), "%s", new_name);
4386 handle_group_rename(g, prevname); 4386 handle_group_rename(g, prevname);
4387 /* FIXME, i don't like calling this. it's sloppy. */ build_edit_tree(); 4387 /* FIXME, i don't like calling this. it's sloppy. */ build_edit_tree();
4463 GSList *gr; 4463 GSList *gr;
4464 4464
4465 new_name = gtk_entry_get_text(GTK_ENTRY(entry)); 4465 new_name = gtk_entry_get_text(GTK_ENTRY(entry));
4466 b = gtk_object_get_user_data(obj); 4466 b = gtk_object_get_user_data(obj);
4467 4467
4468 if (!g_slist_find(connections, b->user->gc)) { 4468 if (!g_slist_find(connections, b->account->gc)) {
4469 destroy_dialog(rename_bud_dialog, rename_bud_dialog); 4469 destroy_dialog(rename_bud_dialog, rename_bud_dialog);
4470 return; 4470 return;
4471 } 4471 }
4472 4472
4473 gr = groups; 4473 gr = groups;
4483 4483
4484 if (new_name && (strlen(new_name) != 0) && strcmp(new_name, b->name)) { 4484 if (new_name && (strlen(new_name) != 0) && strcmp(new_name, b->name)) {
4485 struct group *g = find_group_by_buddy(b); 4485 struct group *g = find_group_by_buddy(b);
4486 char *prevname = g_strdup(b->name); 4486 char *prevname = g_strdup(b->name);
4487 if (g) 4487 if (g)
4488 serv_remove_buddy(b->user->gc, b->name, g->name); 4488 serv_remove_buddy(b->account->gc, b->name, g->name);
4489 g_snprintf(b->name, sizeof(b->name), "%s", new_name); 4489 g_snprintf(b->name, sizeof(b->name), "%s", new_name);
4490 serv_add_buddy(b->user->gc, b->name); 4490 serv_add_buddy(b->account->gc, b->name);
4491 handle_buddy_rename(b, prevname); 4491 handle_buddy_rename(b, prevname);
4492 gaim_blist_save(); 4492 gaim_blist_save();
4493 g_free(prevname); 4493 g_free(prevname);
4494 } 4494 }
4495 4495
5341 tmp = b->custom(b); 5341 tmp = b->custom(b);
5342 5342
5343 /* 5343 /*
5344 * Set the user info and (possibly) send to the server 5344 * Set the user info and (possibly) send to the server
5345 */ 5345 */
5346 if (b->user) { 5346 if (b->account) {
5347 strncpy(b->user->user_info, tmp, sizeof b->user->user_info); 5347 strncpy(b->account->user_info, tmp, sizeof b->account->user_info);
5348 gc = b->user->gc; 5348 gc = b->account->gc;
5349 5349
5350 save_prefs(); 5350 save_prefs();
5351 5351
5352 if (gc) 5352 if (gc)
5353 serv_set_info(gc, b->user->user_info); 5353 serv_set_info(gc, b->account->user_info);
5354 } 5354 }
5355 5355
5356 g_free(tmp); 5356 g_free(tmp);
5357 5357
5358 /* Let multi-edit dialog window "destroy" event catching handle remaining cleanup */ 5358 /* Let multi-edit dialog window "destroy" event catching handle remaining cleanup */