aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog12
-rw-r--r--mail/folder-browser.c33
2 files changed, 18 insertions, 27 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index b4169c829b..c9bd7c221d 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,17 @@
2000-11-07 Jeffrey Stedfast <fejj@helixcode.com>
+ * folder-browser.c (search_save): Don't handle custom searching
+ anymore... we don't want this.
+ (search_full): Same.
+ (folder_browser_search_menu_activated): Set the search entry
+ widget sensitive.
+ (folder_browser_search_query_changed): Same.
+ (search_full_clicked): Set the text of the disabled search entry
+ to the search query string (as search_save depends on this
+ string). Would it be better to save this somewhere else?
+
+2000-11-07 Jeffrey Stedfast <fejj@helixcode.com>
+
* folder-browser.c (search_full_clicked): Updated to use the
ESearchBar object rather than the previously used search widgets.
(search_full): Same.
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 99e8e07bdf..d1c8fbb8a9 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -163,7 +163,6 @@ enum {
ESB_SUBJECT_CONTAINS,
ESB_BODY_DOES_NOT_CONTAIN,
ESB_SUBJECT_DOES_NOT_CONTAIN,
- ESB_CUSTOM_SEARCH,
};
static ESearchBarItem folder_browser_search_option_items[] = {
@@ -172,7 +171,6 @@ static ESearchBarItem folder_browser_search_option_items[] = {
{ N_("Subject contains"), ESB_SUBJECT_CONTAINS },
{ N_("Body does not contain"), ESB_BODY_DOES_NOT_CONTAIN },
{ N_("Subject does not contain"), ESB_SUBJECT_DOES_NOT_CONTAIN },
- { N_("Custom search"), ESB_CUSTOM_SEARCH },
{ NULL, -1 }
};
@@ -185,7 +183,6 @@ static char *search_string[] = {
"(match-all (header-contains \"Subject\" %s)",
"(match-all (not (body-contains %s)))",
"(match-all (not (header-contains \"Subject\" %s)))",
- "%s",
};
static void
@@ -197,6 +194,7 @@ search_full_clicked (MailSearchDialogue *msd, guint button, FolderBrowser *fb)
case 0: /* 'ok' */
case 1: /* 'search' */
query = mail_search_dialogue_get_query (msd);
+ gtk_entry_set_text (GTK_ENTRY (fb->search->entry), query);
message_list_set_search (fb->message_list, query);
g_free (query);
@@ -227,8 +225,6 @@ search_full (GtkWidget *w, FolderBrowser *fb)
{
MailSearchDialogue *msd;
- /* make search dialogue thingy match */
- gtk_menu_set_active (GTK_MENU (GTK_OPTION_MENU (fb->search->option)->menu), ESB_CUSTOM_SEARCH);
gtk_widget_set_sensitive (fb->search->entry, FALSE);
msd = mail_search_dialogue_new_with_rule (fb->search_full);
@@ -249,15 +245,9 @@ search_save (GtkWidget *w, FolderBrowser *fb)
index = fb->search->option_choice;
- /* some special case code for the custom search position */
- if (index == ESB_CUSTOM_SEARCH) {
+ if (text == NULL || text[0] == 0) {
g_free (text);
- text = g_strdup (_("Custom"));
- } else {
- if (text == NULL || text[0] == 0) {
- g_free (text);
- return;
- }
+ return;
}
rule = vfolder_rule_new ();
@@ -266,20 +256,6 @@ search_save (GtkWidget *w, FolderBrowser *fb)
filter_rule_set_name ((FilterRule *)rule, text);
switch (index) {
- case ESB_CUSTOM_SEARCH:
- if (fb->search_full) {
- GList *partl;
-
- /* copy the parts from the search rule to the vfolder rule */
- partl = fb->search_full->parts;
- while (partl) {
- FilterPart *old = partl->data;
- part = filter_part_clone (old);
- filter_rule_add_part ((FilterRule *)rule, part);
- partl = g_list_next (partl);
- }
- break;
- }
default:
/* header or body contains */
index = ESB_BODY_SUBJECT_CONTAINS;
@@ -332,6 +308,7 @@ folder_browser_search_menu_activated (ESearchBar *esb, int id, FolderBrowser *fb
switch (id) {
case ESB_SHOW_ALL:
gtk_entry_set_text (GTK_ENTRY (esb->entry), "");
+ gtk_widget_set_sensitive (esb->entry, TRUE);
message_list_set_search (fb->message_list, NULL);
break;
case ESB_ADVANCED:
@@ -350,6 +327,8 @@ folder_browser_search_query_changed (ESearchBar *esb, FolderBrowser *fb)
char *search_word, *str;
int search_type;
+ gtk_widget_set_sensitive (esb->entry, TRUE);
+
gtk_object_get (GTK_OBJECT (esb),
"text", &search_word,
"option_choice", &search_type,