aboutsummaryrefslogtreecommitdiffstats
path: root/filter/filter-filter.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-03-15 14:55:22 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-03-15 14:55:22 +0800
commite8fad70e9ff924c66434cab62775478617550476 (patch)
treefd0cd5cc07a37fede475c884205a11586528ff50 /filter/filter-filter.c
parentd365f590272614905f8d3e6445370645a61ad80c (diff)
downloadgsoc2013-evolution-e8fad70e9ff924c66434cab62775478617550476.tar
gsoc2013-evolution-e8fad70e9ff924c66434cab62775478617550476.tar.gz
gsoc2013-evolution-e8fad70e9ff924c66434cab62775478617550476.tar.bz2
gsoc2013-evolution-e8fad70e9ff924c66434cab62775478617550476.tar.lz
gsoc2013-evolution-e8fad70e9ff924c66434cab62775478617550476.tar.xz
gsoc2013-evolution-e8fad70e9ff924c66434cab62775478617550476.tar.zst
gsoc2013-evolution-e8fad70e9ff924c66434cab62775478617550476.zip
Changed the edit_filter to be a standalone window rather than a widget, so
2001-03-15 Not Zed <NotZed@Ximian.com> * filter.glade: Changed the edit_filter to be a standalone window rather than a widget, so we can get the rule editor part out separately. Same for vfolder editor, and new score, and basic rule editors. * score-editor.c (score_editor_new): Turned back on object stuff, subclass rule-editor, and removed most of the code. * filter-editor.c (filter_editor_new): Turned into an object, subclass rule-editor, removed most of the code. Now we accept the source list during create, and plug that into the glade. * vfolder-editor.c (vfolder_editor_new): Turned back on object stuff, subclass rule-editor, and removed most of the code. * Makefile.am (libfilter_la_SOURCES): Added rule-editor.[ch]. * filter-filter.c (validate): inherit the validate function and also validate the actions part of a filterfilter. * filter-rule.c (filter_rule_validate): New method so that filter rules can validate themselves. (validate): Default implementation, validates base rules. * rule-editor.h: New generic rule editor, to be used for filter editor/vfolder editor/score editor/saved searches editor. svn path=/trunk/; revision=8729
Diffstat (limited to 'filter/filter-filter.c')
-rw-r--r--filter/filter-filter.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/filter/filter-filter.c b/filter/filter-filter.c
index bcd92d8534..ebd3560863 100644
--- a/filter/filter-filter.c
+++ b/filter/filter-filter.c
@@ -29,6 +29,7 @@
#define d(x)
+static int validate(FilterRule *);
static xmlNodePtr xml_encode (FilterRule *);
static int xml_decode (FilterRule *, xmlNodePtr, struct _RuleContext *f);
/*static void build_code(FilterRule *, GString *out);*/
@@ -85,6 +86,7 @@ filter_filter_class_init (FilterFilterClass *class)
object_class->finalize = filter_filter_finalise;
/* override methods */
+ filter_rule->validate = validate;
filter_rule->xml_encode = xml_encode;
filter_rule->xml_decode = xml_decode;
/*filter_rule->build_code = build_code;*/
@@ -167,6 +169,25 @@ filter_filter_build_action (FilterFilter *fr, GString *out)
g_string_append (out, ")\n");
}
+static int
+validate(FilterRule *fr)
+{
+ int valid;
+ GList *parts;
+ FilterFilter *ff = (FilterFilter *)fr;
+
+ valid = ((FilterRuleClass *)(parent_class))->validate(fr);
+
+ /* validate rule actions */
+ parts = ff->actions;
+ while (parts && valid) {
+ valid = filter_part_validate((FilterPart *)parts->data);
+ parts = parts->next;
+ }
+
+ return valid;
+}
+
static xmlNodePtr
xml_encode (FilterRule *fr)
{