aboutsummaryrefslogtreecommitdiffstats
path: root/mail/folder-browser.c
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-05-02 05:51:03 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-05-02 05:51:03 +0800
commit5c3e0a6314fc2a7f58e9b1e80ac1dda0f5068db7 (patch)
treea673c4f8c2d4128a4e1a1ca46540e274188751a5 /mail/folder-browser.c
parent896c775a526e35d8c201c5ba4a27d6b87b25167c (diff)
downloadgsoc2013-evolution-5c3e0a6314fc2a7f58e9b1e80ac1dda0f5068db7.tar
gsoc2013-evolution-5c3e0a6314fc2a7f58e9b1e80ac1dda0f5068db7.tar.gz
gsoc2013-evolution-5c3e0a6314fc2a7f58e9b1e80ac1dda0f5068db7.tar.bz2
gsoc2013-evolution-5c3e0a6314fc2a7f58e9b1e80ac1dda0f5068db7.tar.lz
gsoc2013-evolution-5c3e0a6314fc2a7f58e9b1e80ac1dda0f5068db7.tar.xz
gsoc2013-evolution-5c3e0a6314fc2a7f58e9b1e80ac1dda0f5068db7.tar.zst
gsoc2013-evolution-5c3e0a6314fc2a7f58e9b1e80ac1dda0f5068db7.zip
A hackish little quick-search entry. (search_activate): Perform a
2000-05-01 NotZed <NotZed@HelixCode.com> * folder-browser.c (folder_browser_gui_init): A hackish little quick-search entry. (search_activate): Perform a quick-search on the folder subject only. * message-list.c (get_message_info): If there is an active search, then get the data from that ... use this instead of _get_message_info(). (ml_row_count): If we have an active search, get the info from its result. (select_msg): Changed to use get_message_info, so searches work. (ml_value_at): And same here. * mail-display.c: Include missing errno.h. svn path=/trunk/; revision=2724
Diffstat (limited to 'mail/folder-browser.c')
-rw-r--r--mail/folder-browser.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/mail/folder-browser.c b/mail/folder-browser.c
index 1e9603040b..cdb4296205 100644
--- a/mail/folder-browser.c
+++ b/mail/folder-browser.c
@@ -193,8 +193,25 @@ folder_browser_properties_init (FolderBrowser *fb)
}
static void
+search_activate(GtkEntry *entry, FolderBrowser *fb)
+{
+ char *text;
+
+ text = gtk_entry_get_text(entry);
+ if (text == NULL || text[0] == 0) {
+ message_list_set_search (fb->message_list, NULL);
+ } else {
+ char *search = g_strdup_printf("(match-all (header-contains \"Subject\" \"%s\"))", text);
+ message_list_set_search (fb->message_list, search);
+ g_free(search);
+ }
+}
+
+static void
folder_browser_gui_init (FolderBrowser *fb)
{
+ GtkWidget *entry, *hbox, *label;
+
/*
* The panned container
*/
@@ -203,9 +220,26 @@ folder_browser_gui_init (FolderBrowser *fb)
gtk_table_attach (
GTK_TABLE (fb), fb->vpaned,
- 0, 1, 0, 2,
+ 0, 1, 1, 3,
+ GTK_FILL | GTK_EXPAND,
GTK_FILL | GTK_EXPAND,
+ 0, 0);
+
+ /* quick-search entry */
+ hbox = gtk_hbox_new(FALSE, 3);
+ gtk_widget_show(hbox);
+ entry = gtk_entry_new();
+ gtk_widget_show(entry);
+ gtk_signal_connect(entry, "activate", search_activate, fb);
+ label = gtk_label_new("Search (subject contains)");
+ gtk_widget_show(label);
+ gtk_box_pack_end((GtkBox *)hbox, entry, FALSE, FALSE, 3);
+ gtk_box_pack_end((GtkBox *)hbox, label, FALSE, FALSE, 3);
+ gtk_table_attach (
+ GTK_TABLE (fb), hbox,
+ 0, 1, 0, 1,
GTK_FILL | GTK_EXPAND,
+ 0,
0, 0);
fb->message_list_w = message_list_get_widget (fb->message_list);