aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-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);