changeset 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 cf0c383beebb
children 6f049002d963
files src/multi.c src/prpl.c
diffstat 2 files changed, 23 insertions(+), 13 deletions(-) [+]
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)
--- a/src/prpl.c	Wed Jun 13 05:33:38 2001 +0000
+++ b/src/prpl.c	Wed Jun 13 06:44:03 2001 +0000
@@ -159,7 +159,8 @@
 
 	button = picture_button(window, _("Accept"), ok_xpm);
 	gtk_box_pack_end(GTK_BOX(hbox), button, FALSE, FALSE, 0);
-	gtk_object_set_user_data(GTK_OBJECT(button), data);
+	if (dont)
+		gtk_object_set_user_data(GTK_OBJECT(button), data);
 	if (doit)
 		gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(doit), data);
 	gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(rem_win), window);