From 0f301f38bc499beb749049c879715af7037c8fea Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 23 Jan 2001 23:51:04 +0000 Subject: Patch from Tuomas to have a "Sender contains" rule in the quicksearch bar. svn path=/trunk/; revision=7764 --- mail/ChangeLog | 14 ++++++++++++++ mail/folder-browser.c | 11 +++++++++++ 2 files changed, 25 insertions(+) diff --git a/mail/ChangeLog b/mail/ChangeLog index 874e179d4c..6fee495c34 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,17 @@ +2001-01-23 Ettore Perazzoli + + [Applied patch from Tuomas Kuosmanen ] + + * folder-browser.c: Added enum value `ESB_SENDER_CONTAINS' as well + as a "Sender contains" item to the search menu. Also add a + corresponding "(match-all)" rule to the `search_string' array. + (search_save): Handle `ESB_SENDER_CONTAINS' here. + +2001-01-23 Ettore Perazzoli + + * GNOME_Evolution_Mail.oafinfo: Fixed the repo_ids so that they + use the right syntax. + 2001-01-23 Dan Winship * folder-browser-factory.c: diff --git a/mail/folder-browser.c b/mail/folder-browser.c index 241c8a5d9e..700eda72f5 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -227,6 +227,7 @@ static ESearchBarItem folder_browser_search_menu_items[] = { }; enum { + ESB_SENDER_CONTAINS, ESB_BODY_SUBJECT_CONTAINS, ESB_BODY_CONTAINS, ESB_SUBJECT_CONTAINS, @@ -235,6 +236,7 @@ enum { }; static ESearchBarItem folder_browser_search_option_items[] = { + { N_("Sender contains"), ESB_SENDER_CONTAINS }, { N_("Body or subject contains"), ESB_BODY_SUBJECT_CONTAINS }, { N_("Body contains"), ESB_BODY_CONTAINS }, { N_("Subject contains"), ESB_SUBJECT_CONTAINS }, @@ -247,6 +249,7 @@ static ESearchBarItem folder_browser_search_option_items[] = { /* %s is replaced by the whole search string in quotes ... possibly could split the search string into words as well ? */ static char *search_string[] = { + "(match-all (header-contains \"from\" %s)", "(or (body-contains %s) (match-all (header-contains \"Subject\" %s)))", "(body-contains %s)", "(match-all (header-contains \"Subject\" %s)", @@ -327,6 +330,14 @@ search_save (GtkWidget *w, FolderBrowser *fb) default: /* header or body contains */ index = ESB_BODY_SUBJECT_CONTAINS; + case ESB_SENDER_CONTAINS: + part = vfolder_create_part ("from"); + filter_rule_add_part ((FilterRule *)rule, part); + element = filter_part_find_element (part, "from-type"); + filter_option_set_current ((FilterOption *)element, "contains"); + element = filter_part_find_element (part, "from"); + filter_input_set_value ((FilterInput *)element, text); + break; case ESB_BODY_CONTAINS: case ESB_SUBJECT_CONTAINS: if (index == ESB_BODY_SUBJECT_CONTAINS || index == ESB_BODY_CONTAINS) { -- cgit v1.2.3