aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-03-18 16:31:28 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-03-18 16:31:28 +0800
commit962307293176c46e0f39ac9c0639eacf584a50c4 (patch)
tree2f670fdc2efd541fe012909001400b8c2107a269
parent3a1c2dfaef44cebfa223a9d3557913efe36ead3f (diff)
downloadgsoc2013-evolution-962307293176c46e0f39ac9c0639eacf584a50c4.tar.gz
gsoc2013-evolution-962307293176c46e0f39ac9c0639eacf584a50c4.tar.zst
gsoc2013-evolution-962307293176c46e0f39ac9c0639eacf584a50c4.zip
validate rule & rule is unique. Workaround for #39464. Should this just
2003-03-18 Not Zed <NotZed@Ximian.com> * mail-vfolder.c (new_rule_clicked): validate rule & rule is unique. Workaround for #39464. Should this just use rule_context_add_rule_gui?? svn path=/trunk/; revision=20333
-rw-r--r--mail/ChangeLog4
-rw-r--r--mail/mail-vfolder.c19
2 files changed, 23 insertions, 0 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 82c62c60b4..c2cb4a3252 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,9 @@
2003-03-18 Not Zed <NotZed@Ximian.com>
+ * mail-vfolder.c (new_rule_clicked): validate rule & rule is
+ unique. Workaround for #39464. Should this just use
+ rule_context_add_rule_gui??
+
* mail-search.c (mail_search_destroy): unhook from the html engine
signals here, before we redisplay the message. Also make sure
this processing only happens once. For #39759.
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c
index d8f30087d6..de90ffac19 100644
--- a/mail/mail-vfolder.c
+++ b/mail/mail-vfolder.c
@@ -903,6 +903,25 @@ new_rule_clicked(GtkWidget *w, int button, void *data)
char *user;
FilterRule *rule = g_object_get_data((GObject *)w, "rule");
+ if (!filter_rule_validate(rule)) {
+ /* no need to popup a dialog because the validate code does that. */
+ return;
+ }
+
+ if (rule_context_find_rule ((RuleContext *)context, rule->name, rule->source)) {
+ GtkWidget *dialog =
+ gtk_message_dialog_new ((GtkWindow *) w, GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+ _("Rule name '%s' is not unique, choose another."),
+ rule->name);
+
+ gtk_dialog_run ((GtkDialog *) dialog);
+ gtk_widget_destroy (dialog);
+
+ return;
+ }
+
+
g_object_ref(rule);
rule_context_add_rule((RuleContext *)context, rule);
user = g_strdup_printf("%s/vfolders.xml", evolution_dir);