comparison src/multi.c @ 2007:948a67a691a6

[gaim-migrate @ 2017] confirm delete committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 13 Jun 2001 06:44:03 +0000
parents c9c20663e05b
children 6f049002d963
comparison
equal deleted inserted replaced
2006:cf0c383beebb 2007:948a67a691a6
618 signoff(u->gc); 618 signoff(u->gc);
619 } 619 }
620 } 620 }
621 } 621 }
622 622
623 static void do_del_acct(gpointer w, struct aim_user *u)
624 {
625 if (u->gc) {
626 u->gc->wants_to_die = TRUE;
627 signoff(u->gc);
628 }
629 gtk_clist_remove(GTK_CLIST(list), g_list_index(aim_users, u));
630 aim_users = g_list_remove(aim_users, u);
631 save_prefs();
632 }
633
623 static void del_acct(GtkWidget *w, gpointer d) 634 static void del_acct(GtkWidget *w, gpointer d)
624 { 635 {
636 char buf[8192];
625 int row = -1; 637 int row = -1;
626 struct aim_user *u; 638 struct aim_user *u;
627 if (GTK_CLIST(list)->selection) 639 if (GTK_CLIST(list)->selection)
628 row = (int)GTK_CLIST(list)->selection->data; 640 row = (int)GTK_CLIST(list)->selection->data;
629 if (row != -1) { 641 if (row == -1)
630 u = g_list_nth_data(aim_users, row); 642 return;
631 if (u) { 643
632 if (u->gc) { 644 u = g_list_nth_data(aim_users, row);
633 u->gc->wants_to_die = TRUE; 645 if (!u)
634 signoff(u->gc); 646 return;
635 } 647
636 aim_users = g_list_remove(aim_users, u); 648 g_snprintf(buf, sizeof(buf), _("Are you sure you want to delete %s?"), u->username);
637 save_prefs(); 649 do_ask_dialog(buf, u, do_del_acct, NULL);
638 }
639 gtk_clist_remove(GTK_CLIST(list), row);
640 }
641 } 650 }
642 651
643 void account_editor(GtkWidget *w, GtkWidget *W) 652 void account_editor(GtkWidget *w, GtkWidget *W)
644 { 653 {
645 /* please kill me */ 654 /* please kill me */