diff options
author | Not Zed <NotZed@Ximian.com> | 2003-03-18 16:21:34 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2003-03-18 16:21:34 +0800 |
commit | 3a1c2dfaef44cebfa223a9d3557913efe36ead3f (patch) | |
tree | 2f8cc2fcdfa04c508149ba0395350e0281bce162 | |
parent | 12489e58587ade723163cae225d34907c1d0ed51 (diff) | |
download | gsoc2013-evolution-3a1c2dfaef44cebfa223a9d3557913efe36ead3f.tar.gz gsoc2013-evolution-3a1c2dfaef44cebfa223a9d3557913efe36ead3f.tar.zst gsoc2013-evolution-3a1c2dfaef44cebfa223a9d3557913efe36ead3f.zip |
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
-rw-r--r-- | filter/ChangeLog | 5 | ||||
-rw-r--r-- | filter/rule-context.c | 14 |
2 files changed, 18 insertions, 1 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog index c47fc46cf5..ba8e61c74f 100644 --- a/filter/ChangeLog +++ b/filter/ChangeLog @@ -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 diff --git a/filter/rule-context.c b/filter/rule-context.c index c7208dbd69..a131db6d63 100644 --- a/filter/rule-context.c +++ b/filter/rule-context.c @@ -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); |