aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-05-11 12:27:35 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-05-11 12:27:35 +0800
commit59c9d146b95fdf399b64971d6b86d9e8a5474157 (patch)
treeb53a6c5bcea1ca1c1c749018fdcd2fcad0207852 /mail/folder-browser.c
parentfce621fd558b52b3bdcca568af4c2676ba2e461c (diff)
downloadgsoc2013-evolution-59c9d146b95fdf399b64971d6b86d9e8a5474157.tar.gz
gsoc2013-evolution-59c9d146b95fdf399b64971d6b86d9e8a5474157.tar.zst
gsoc2013-evolution-59c9d146b95fdf399b64971d6b86d9e8a5474157.zip
Use the ESearchingTokenizer to highlight search matches for folder-level
2001-05-10 Jon Trowbridge <trow@ximian.com> * 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
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c12
1 files changed, 12 insertions, 0 deletions
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 <gal/widgets/e-popup-menu.h>
#include <gal/widgets/e-unicode.h>
+#include <gtkhtml/htmlengine.h>
+
#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