[evolution/wip/webkit2] Bug 759618 - Removing a message filter should prompt for confirmation
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit2] Bug 759618 - Removing a message filter should prompt for confirmation
- Date: Thu, 3 Mar 2016 13:45:40 +0000 (UTC)
commit 1480458c2a1192aab99b633a590f8a8da0d6a77e
Author: Milan Crha <mcrha redhat com>
Date: Fri Jan 29 13:35:36 2016 +0100
Bug 759618 - Removing a message filter should prompt for confirmation
e-util/e-rule-editor.c | 15 +++++++++++++++
e-util/filter.error.xml | 5 +++++
2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-rule-editor.c b/e-util/e-rule-editor.c
index c99efa1..7fe08f3 100644
--- a/e-util/e-rule-editor.c
+++ b/e-util/e-rule-editor.c
@@ -320,6 +320,21 @@ rule_delete (GtkWidget *widget,
pos = e_rule_context_get_rank_rule (editor->context, editor->current, editor->source);
if (pos != -1) {
+ GtkWindow *parent;
+ GtkWidget *toplevel;
+ gint response;
+
+ toplevel = gtk_widget_get_toplevel (widget);
+ parent = GTK_IS_WINDOW (toplevel) ? GTK_WINDOW (toplevel) : NULL;
+
+ response = e_alert_run_dialog_for_args (parent, "filter:remove-rule-question",
+ (editor->current && editor->current->name) ? editor->current->name : "", NULL);
+
+ if (response != GTK_RESPONSE_YES)
+ pos = -1;
+ }
+
+ if (pos != -1) {
EFilterRule *delete_rule = editor->current;
editor->current = NULL;
diff --git a/e-util/filter.error.xml b/e-util/filter.error.xml
index dbce98d..1cb20e6 100644
--- a/e-util/filter.error.xml
+++ b/e-util/filter.error.xml
@@ -41,4 +41,9 @@
<_secondary>One or more values cannot be empty.</_secondary>
</error>
+ <error id="remove-rule-question" type="question" default="GTK_RESPONSE_YES">
+ <_primary>Are you sure you want to remove rule '{0}'?</_primary>
+ <button _label="_Keep" response="GTK_RESPONSE_CANCEL"/>
+ <button _label="_Remove" response="GTK_RESPONSE_YES"/>
+ </error>
</error-list>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]