From 7c6897ee95e4346e991185c014bcfce003809fd8 Mon Sep 17 00:00:00 2001 From: NotZed Date: Tue, 22 Feb 2000 10:09:07 +0000 Subject: New utility functions for working with the internal rule format. 2000-02-22 NotZed * filter-xml.c (filter_clone_optionrule): (filter_clone_optionrule_free): (filter_optionrule_new_from_rule): New utility functions for working with the internal rule format. * filter-arg.[ch]: Added new callbacks for editing a single value, and a new editor which shows all items in a list, and allows you to edit them via the single-edit method. This needs some cleanup for some unused/unusable virtual methods (edit_values, write_html?). * Makefile: Add the druid for build. * filter-druid.c: A 'druid' widget for editing a single filter rule. svn path=/trunk/; revision=1901 --- filter/filter-driver.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'filter/filter-driver.c') diff --git a/filter/filter-driver.c b/filter/filter-driver.c index b51e3f0705..c2759fe9d8 100644 --- a/filter/filter-driver.c +++ b/filter/filter-driver.c @@ -138,6 +138,8 @@ find_optionrule(struct filter_option *option, char *name) return NULL; } +static char nooption[] = "

Select option

Select an option type from the list above.

"; + void html_write_options(GtkHTML *html, struct filter_option *option) { @@ -146,13 +148,17 @@ html_write_options(GtkHTML *html, struct filter_option *option) stream = gtk_html_begin(html, ""); gtk_html_write(html, stream, "", strlen("")); - optionrulel = option->options; - while (optionrulel) { - struct filter_optionrule *or = optionrulel->data; - - filter_description_html_write(or->rule->description, or->args, html, stream); - gtk_html_write(html, stream, "
", strlen("
")); - optionrulel = g_list_next(optionrulel); + if (option) { + optionrulel = option->options; + while (optionrulel) { + struct filter_optionrule *or = optionrulel->data; + + filter_description_html_write(or->rule->description, or->args, html, stream); + gtk_html_write(html, stream, "
", strlen("
")); + optionrulel = g_list_next(optionrulel); + } + } else { + gtk_html_write(html, stream, nooption, strlen(nooption)); } gtk_html_end(html, stream, GTK_HTML_STREAM_OK); } -- cgit v1.2.3