diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-11-13 08:57:10 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-11-13 08:57:10 +0800 |
commit | 8d4f7dd527a290483ae4456bc23cd4a9ee0cf4e7 (patch) | |
tree | 8c9a74146d49e5b19a1166aa828710de03900046 /filter/vfolder-rule.c | |
parent | 6f6b1c0af0b8a7bf1a87a0b2089a88059423da38 (diff) | |
download | gsoc2013-evolution-8d4f7dd527a290483ae4456bc23cd4a9ee0cf4e7.tar.gz gsoc2013-evolution-8d4f7dd527a290483ae4456bc23cd4a9ee0cf4e7.tar.zst gsoc2013-evolution-8d4f7dd527a290483ae4456bc23cd4a9ee0cf4e7.zip |
Force the user to name the filter.
2001-11-12 Jeffrey Stedfast <fejj@ximian.com>
* filter-rule.c (validate): Force the user to name the filter.
* vfolder-rule.c (validate): Force the user to name the vfolder.
svn path=/trunk/; revision=14679
Diffstat (limited to 'filter/vfolder-rule.c')
-rw-r--r-- | filter/vfolder-rule.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/filter/vfolder-rule.c b/filter/vfolder-rule.c index 4980151a42..f940747c71 100644 --- a/filter/vfolder-rule.c +++ b/filter/vfolder-rule.c @@ -196,21 +196,29 @@ vfolder_rule_next_source (VfolderRule *vr, const char *last) static gint validate (FilterRule *fr) { + GtkWidget *dialog; + + g_return_val_if_fail (fr != NULL, FALSE); + + if (!fr->name || !*fr->name) { + dialog = gnome_ok_dialog (_("You must name this vfolder.")); + gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + + return 0; + } + /* We have to have at least one source set in the "specific" case. Do not translate this string! */ - if (fr && fr->source && !strcmp (fr->source, "specific") && VFOLDER_RULE (fr)->sources == NULL) { - - GtkWidget *gd; - - gd = gnome_ok_dialog (_("You need to to specify at least one folder as a source.")); - gnome_dialog_run_and_close (GNOME_DIALOG (gd)); - + if (fr->source && !strcmp (fr->source, "specific") && VFOLDER_RULE (fr)->sources == NULL) { + dialog = gnome_ok_dialog (_("You need to to specify at least one folder as a source.")); + gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); + return 0; } - + if (FILTER_RULE_CLASS (parent_class)->validate) return FILTER_RULE_CLASS (parent_class)->validate (fr); - + return 1; } |