From 59c9d146b95fdf399b64971d6b86d9e8a5474157 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Fri, 11 May 2001 04:27:35 +0000 Subject: Use the ESearchingTokenizer to highlight search matches for folder-level 2001-05-10 Jon Trowbridge * folder-browser.c (folder_browser_config_search): Use the ESearchingTokenizer to highlight search matches for folder-level searches. Still mildly broken, but it works for the simple cases. * mail-display.c (mail_display_new): Use our ESearchingTokenizer for the mail display GtkHTML widget. * mail-search.c (dialog_clicked_cb): Use the ESearchingTokenizer to highlight search matches. (mail_search_construct): Add a match count to the search dialog. * e-searching-tokenizer.c (e_searching_tokenizer_set_search_string): Added. A custom HTML tokenizer that does highlighting of search strings. svn path=/trunk/; revision=9754 --- mail/folder-browser.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mail/folder-browser.c') diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 09da831955..74bce1c6c8 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -22,6 +22,8 @@ #include #include +#include + #include "filter/vfolder-rule.h" #include "filter/vfolder-context.h" #include "filter/filter-option.h" @@ -30,6 +32,7 @@ #include "mail-search-dialogue.h" #include "e-util/e-sexp.h" #include "folder-browser.h" +#include "e-searching-tokenizer.h" #include "mail.h" #include "mail-callbacks.h" #include "mail-tools.h" @@ -293,8 +296,14 @@ folder_browser_search_menu_activated (ESearchBar *esb, int id, FolderBrowser *fb static void folder_browser_config_search(EFilterBar *efb, FilterRule *rule, int id, const char *query, void *data) { + FolderBrowser *fb = FOLDER_BROWSER (data); + ESearchingTokenizer *st; GList *partl; + st = E_SEARCHING_TOKENIZER (fb->mail_display->html->engine->ht); + + e_searching_tokenizer_set_search_string (st, NULL); + /* we scan the parts of a rule, and set all the types we know about to the query string */ partl = rule->parts; while (partl) { @@ -308,6 +317,7 @@ static void folder_browser_config_search(EFilterBar *efb, FilterRule *rule, int FilterInput *input = (FilterInput *)filter_part_find_element(part, "word"); if (input) filter_input_set_value(input, query); + e_searching_tokenizer_set_search_string (st, query); } else if(!strcmp(part->name, "sender")) { FilterInput *input = (FilterInput *)filter_part_find_element(part, "sender"); if (input) @@ -317,6 +327,8 @@ static void folder_browser_config_search(EFilterBar *efb, FilterRule *rule, int partl = partl->next; } printf("configuring search for search string '%s', rule is '%s'\n", query, rule->name); + + mail_display_redisplay (fb->mail_display, FALSE); } static void -- cgit