From 0eb24eaa396b7f5f3ebe6fab21080cda7ba7d4bc Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 31 Oct 2000 03:43:26 +0000 Subject: If a regex option is selected, change the FilterElement data to TRUE else 2000-10-30 Jeffrey Stedfast * filter-option.c (option_activate): If a regex option is selected, change the FilterElement data to TRUE else set to FALSE. * filter-rule.c (more_parts): Validate the previously entered FilterPart before allowing the user to add a new FilterPart. * filter-part.c (filter_part_validate): New convenience function to validate an entire FilterPart expression. * filter-input.c (validate): Validate the entry text if it contains a regular expression. * filter-element.[c,h]: New virtual function to validate the contents of the FilterElement (useful for regex and sexp). (filter_element_validate): You get the idea... svn path=/trunk/; revision=6285 --- filter/filter-element.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'filter/filter-element.c') diff --git a/filter/filter-element.c b/filter/filter-element.c index 21df744fe5..ad6e133a6a 100644 --- a/filter/filter-element.c +++ b/filter/filter-element.c @@ -31,6 +31,7 @@ #include "filter-folder.h" #include "filter-url.h" +static gboolean validate (FilterElement *fe, gpointer data); static void xml_create(FilterElement *fe, xmlNodePtr node); static FilterElement *clone(FilterElement *fe); @@ -83,6 +84,7 @@ filter_element_class_init (FilterElementClass *class) object_class->finalize = filter_element_finalise; /* override methods */ + class->validate = validate; class->xml_create = xml_create; class->clone = clone; @@ -121,6 +123,12 @@ filter_element_new (void) return o; } +gboolean +filter_element_validate (FilterElement *fe, gpointer data) +{ + return ((FilterElementClass *)((GtkObject *)fe)->klass)->validate (fe, data); +} + /** * filter_element_xml_create: * @fe: filter element @@ -261,6 +269,12 @@ filter_element_new_type_name (const char *type) } /* default implementations */ +static gboolean +validate (FilterElement *fe, gpointer data) +{ + return TRUE; +} + static void xml_create (FilterElement *fe, xmlNodePtr node) { @@ -280,5 +294,3 @@ clone (FilterElement *fe) return new; } - - -- cgit v1.2.3