use the same code as in filter-rule to enforce unique names for all

2003-03-18  Not Zed  <NotZed@Ximian.com>

        * rule-context.c (new_rule_response): use the same code as in
        filter-rule to enforce unique names for all rules/vfolders.

svn path=/trunk/; revision=20332
This commit is contained in:
Not Zed
2003-03-18 08:21:34 +00:00
committed by Michael Zucci
parent 12489e5858
commit 3a1c2dfaef
2 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2003-03-18 Not Zed <NotZed@Ximian.com>
* rule-context.c (new_rule_response): use the same code as in
filter-rule to enforce unique names for all rules/vfolders.
2003-03-17 Jeffrey Stedfast <fejj@ximian.com>
* rule-editor.c (rule_editor_construct): Set the default window

View File

@ -33,7 +33,7 @@
#include <errno.h>
#include <gtk/gtk.h>
#include <libgnome/gnome-i18n.h>
#include <gal/util/e-xml-utils.h>
#include "rule-context.h"
@ -654,6 +654,18 @@ new_rule_response(GtkWidget *dialog, int button, RuleContext *context)
/* no need to popup a dialog because the validate code does that. */
return;
}
if (rule_context_find_rule (context, rule->name, rule->source)) {
dialog = gtk_message_dialog_new ((GtkWindow *) dialog, 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(context, rule);