diff options
author | TingPing <tngpng@gmail.com> | 2013-03-22 18:22:56 -0300 |
---|---|---|
committer | TingPing <tngpng@gmail.com> | 2013-03-22 18:22:56 -0300 |
commit | b282c6f2f3a608b583a3ea345bf6489ee95fd6c0 (patch) | |
tree | f39d00d52dce50dfc6dabb7e71e388db7d98016a /src/fe-gtk | |
parent | d37ef26104d3b302d983cf444595f8226e0bbb30 (diff) |
add confirm dialog to clearing ignores
Diffstat (limited to 'src/fe-gtk')
-rw-r--r-- | src/fe-gtk/ignoregui.c | 20 |
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", |