summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/fe-gtk/ignoregui.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/fe-gtk/ignoregui.c b/src/fe-gtk/ignoregui.c
index 6e8b4ff3..34a06837 100644
--- a/src/fe-gtk/ignoregui.c
+++ b/src/fe-gtk/ignoregui.c
@@ -273,13 +273,15 @@ ignore_store_new (int cancel, char *mask, gpointer data)
 }
 
 static void
-ignore_clear_entry_clicked (GtkWidget * wid, gpointer unused)
+ignore_clear_cb (GtkDialog *dialog, gint response)
 {
 	GtkListStore *store = GTK_LIST_STORE (get_store ());
 	GtkTreeIter iter;
 	char *mask;
 
-	if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter))
+	gtk_widget_destroy (GTK_WIDGET (dialog));
+
+	if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (store), &iter) && response == GTK_RESPONSE_OK)
 	{
 		/* remove from ignore_list */
 		do
@@ -297,6 +299,20 @@ ignore_clear_entry_clicked (GtkWidget * wid, gpointer unused)
 }
 
 static void
+ignore_clear_entry_clicked (GtkWidget * wid)
+{
+	GtkWidget *dialog;
+
+	dialog = gtk_message_dialog_new (NULL, 0,
+								GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL,
+					_("Are you sure you want to remove all ignores?"));
+	g_signal_connect (G_OBJECT (dialog), "response",
+							G_CALLBACK (ignore_clear_cb), NULL);
+	gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
+	gtk_widget_show (dialog);
+}
+
+static void
 ignore_new_entry_clicked (GtkWidget * wid, struct session *sess)
 {
 	fe_get_str (_("Enter mask to ignore:"), "nick!userid@host.com",