aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-05-16 09:15:33 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-05-16 09:15:33 +0800
commite4720a7e38d3073570df95fbd98481109d53b3a8 (patch)
tree0ffef561f795d11a970c400fd7c22daf0023b008
parent8d95e8c29eef49a9ec7db5d129cd5cf18cfc3816 (diff)
downloadgsoc2013-evolution-e4720a7e38d3073570df95fbd98481109d53b3a8.tar
gsoc2013-evolution-e4720a7e38d3073570df95fbd98481109d53b3a8.tar.gz
gsoc2013-evolution-e4720a7e38d3073570df95fbd98481109d53b3a8.tar.bz2
gsoc2013-evolution-e4720a7e38d3073570df95fbd98481109d53b3a8.tar.lz
gsoc2013-evolution-e4720a7e38d3073570df95fbd98481109d53b3a8.tar.xz
gsoc2013-evolution-e4720a7e38d3073570df95fbd98481109d53b3a8.tar.zst
gsoc2013-evolution-e4720a7e38d3073570df95fbd98481109d53b3a8.zip
filename based interface. (filter_editor_save_rules): Interface to save
2000-05-15 NotZed <NotZed@HelixCode.com> * filter-editor.c (filter_editor_set_rule_files): filename based interface. (filter_editor_save_rules): Interface to save the options to a filename. svn path=/trunk/; revision=3052
-rw-r--r--filter/ChangeLog5
-rw-r--r--filter/filter-editor.c38
-rw-r--r--filter/filter-editor.h2
3 files changed, 21 insertions, 24 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index 1d759230ef..ace9116829 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,5 +1,10 @@
2000-05-15 NotZed <NotZed@HelixCode.com>
+ * filter-editor.c (filter_editor_set_rule_files): filename based
+ interface.
+ (filter_editor_save_rules): Interface to save the options to a
+ filename.
+
* filter-xml.[ch]: Bunch of cleanup.
* filter-xml.c (filter_*_file): New interfaces to read/write files
diff --git a/filter/filter-editor.c b/filter/filter-editor.c
index 82e57afb4e..d65398872b 100644
--- a/filter/filter-editor.c
+++ b/filter/filter-editor.c
@@ -338,33 +338,23 @@ filter_editor_set_rules(FilterEditor *e, GList *rules, GList *systemoptions, GLi
filter_druid_set_rules(p->druid, useroptions, rules, NULL);
}
-#ifdef TESTING
-int main(int argc, char **argv)
+void
+filter_editor_set_rule_files(FilterEditor *e, const char *systemrules, const char *userrules)
{
GList *rules, *options, *options2;
xmlDocPtr doc, out, optionset, filteroptions;
- GString *s;
-
- gnome_init("Test", "0.0", argc, argv);
- gdk_rgb_init ();
- gtk_widget_set_default_colormap (gdk_rgb_get_cmap ());
- gtk_widget_set_default_visual (gdk_rgb_get_visual ());
-
- {
-
- GtkWidget *w = filter_editor_new();
-
- doc = xmlParseFile("filterdescription.xml");
- rules = filter_load_ruleset(doc);
- options = filter_load_optionset(doc, rules);
- options2 = options;
- out = xmlParseFile("saveoptions.xml");
- options = filter_load_optionset(out, rules);
- filter_editor_set_rules(w, rules, options2, options);
+ doc = xmlParseFile(systemrules);
+ rules = filter_load_ruleset(doc);
+ options2 = filter_load_optionset(doc, rules);
+ out = xmlParseFile(userrules);
+ options = filter_load_optionset(out, rules);
+
+ filter_editor_set_rules(e, rules, options2, options);
+}
- gtk_widget_show(w);
- gtk_main();
- }
+int
+filter_editor_save_rules(FilterEditor *e, const char *userrules)
+{
+ return filter_write_optionset_file(userrules, e->useroptions);
}
-#endif
diff --git a/filter/filter-editor.h b/filter/filter-editor.h
index 212654c4c9..66f7a81e11 100644
--- a/filter/filter-editor.h
+++ b/filter/filter-editor.h
@@ -52,5 +52,7 @@ guint filter_editor_get_type (void);
FilterEditor *filter_editor_new (void);
void filter_editor_set_rules(FilterEditor *e, GList *rules, GList *systemoptions, GList *useroptions);
+void filter_editor_set_rule_files(FilterEditor *e, const char *systemrules, const char *userrules);
+int filter_editor_save_rules(FilterEditor *e, const char *userrules);
#endif /* ! _FILTER_EDITOR_H */