aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-vfolder.c
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 /mail/mail-vfolder.c
parent3a1c2dfaef44cebfa223a9d3557913efe36ead3f (diff)
downloadgsoc2013-evolution-962307293176c46e0f39ac9c0639eacf584a50c4.tar
gsoc2013-evolution-962307293176c46e0f39ac9c0639eacf584a50c4.tar.gz
gsoc2013-evolution-962307293176c46e0f39ac9c0639eacf584a50c4.tar.bz2
gsoc2013-evolution-962307293176c46e0f39ac9c0639eacf584a50c4.tar.lz
gsoc2013-evolution-962307293176c46e0f39ac9c0639eacf584a50c4.tar.xz
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
Diffstat (limited to 'mail/mail-vfolder.c')
-rw-r--r--mail/mail-vfolder.c19
1 files changed, 19 insertions, 0 deletions
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);