Mercurial > pidgin.yaz
diff 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 |
line wrap: on
line diff
--- a/src/multi.c Wed Jun 13 05:33:38 2001 +0000 +++ b/src/multi.c Wed Jun 13 06:44:03 2001 +0000 @@ -620,24 +620,33 @@ } } +static void do_del_acct(gpointer w, struct aim_user *u) +{ + if (u->gc) { + u->gc->wants_to_die = TRUE; + signoff(u->gc); + } + gtk_clist_remove(GTK_CLIST(list), g_list_index(aim_users, u)); + aim_users = g_list_remove(aim_users, u); + save_prefs(); +} + static void del_acct(GtkWidget *w, gpointer d) { + char buf[8192]; int row = -1; struct aim_user *u; if (GTK_CLIST(list)->selection) row = (int)GTK_CLIST(list)->selection->data; - if (row != -1) { - u = g_list_nth_data(aim_users, row); - if (u) { - if (u->gc) { - u->gc->wants_to_die = TRUE; - signoff(u->gc); - } - aim_users = g_list_remove(aim_users, u); - save_prefs(); - } - gtk_clist_remove(GTK_CLIST(list), row); - } + if (row == -1) + return; + + u = g_list_nth_data(aim_users, row); + if (!u) + return; + + g_snprintf(buf, sizeof(buf), _("Are you sure you want to delete %s?"), u->username); + do_ask_dialog(buf, u, do_del_acct, NULL); } void account_editor(GtkWidget *w, GtkWidget *W)
