aboutsummaryrefslogtreecommitdiffstats
path: root/mail/message-list.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-10-09 20:57:36 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-10-09 20:57:36 +0800
commit79154e4ac8759f24656fe55253b25d1c84834337 (patch)
tree2926f0394184b7af6935533263bd413c18cf3585 /mail/message-list.c
parentd0d1c0e3d92f083304a152f633c4448b1975181a (diff)
downloadgsoc2013-evolution-79154e4ac8759f24656fe55253b25d1c84834337.tar
gsoc2013-evolution-79154e4ac8759f24656fe55253b25d1c84834337.tar.gz
gsoc2013-evolution-79154e4ac8759f24656fe55253b25d1c84834337.tar.bz2
gsoc2013-evolution-79154e4ac8759f24656fe55253b25d1c84834337.tar.lz
gsoc2013-evolution-79154e4ac8759f24656fe55253b25d1c84834337.tar.xz
gsoc2013-evolution-79154e4ac8759f24656fe55253b25d1c84834337.tar.zst
gsoc2013-evolution-79154e4ac8759f24656fe55253b25d1c84834337.zip
New widget, full search dialogue for mail.
2000-10-06 Not Zed <NotZed@HelixCode.com> * mail-search-dialogue.c: New widget, full search dialogue for mail. * folder-browser.c (search_set): If we click on custom search, run the full search dialogue. (folder_browser_gui_init): Add a button to perform a full search. (search_full): Bring up the mail search dialogue asynchronously. (search_full_clicked): Handle search options. (folder_browser_destroy): Free the saved rule if there is one there. (search_options[]): Added a custom option option - brings up the full search dialogue. (search_set): Disable the search entry if we are doing a full search. * mail-vfolder.c (vfolder_create_storage): Yay, finally depeterised this stuff. (vfolder_uri_to_folder): Removed an irrelevant comment. * mail-callbacks.c (filter_edit): And here. * mail-ops.c (do_fetch_mail): And here too. * mail-autofilter.c (filter_gui_add_from_message): Fixed call to context_load. (filter_gui_add_for_mailing_list): And here too. * folder-browser-factory.c (create_ondemand_hooks): Remove that ondemand callback snot. 2000-10-05 Not Zed <NotZed@HelixCode.com> * message-list.c (message_list_init_etable): Build the etable once we know what folder we are going to use. (save_header_state): Save the header spec to a cache file. (message_list_destroy): Save the header spec. (message_list_setup_etable): Setup the etable spec for this folder, from a saved version if one exists, or to suit the folder type (sent/received). (message_list_set_folder): Setup the etable here once we have a folder. svn path=/trunk/; revision=5798
Diffstat (limited to 'mail/message-list.c')
-rw-r--r--mail/message-list.c57
1 files changed, 55 insertions, 2 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index 4f02e1d7b8..22f6cb741d 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -87,6 +87,7 @@ static void select_msg (MessageList *message_list, gint row);
static char *filter_date (const void *data);
static void nuke_uids (GtkObject *o);
+static char *folder_to_cachename(CamelFolder *folder, const char *prefix);
static void save_tree_state(MessageList *ml);
static struct {
@@ -933,6 +934,20 @@ message_list_init_header (MessageList *message_list)
}
}
+static void
+save_header_state(MessageList *ml)
+{
+ char *filename;
+
+ if (ml->folder == NULL
+ || ml->etable == NULL)
+ return;
+
+ filename = folder_to_cachename(ml->folder, "et-header-");
+ e_table_scrolled_save_specification(E_TABLE_SCROLLED(ml->etable), filename);
+ g_free(filename);
+}
+
static char *
message_list_get_layout (MessageList *message_list)
{
@@ -940,6 +955,39 @@ message_list_get_layout (MessageList *message_list)
return g_strdup ("<ETableSpecification> <columns-shown> <column> 0 </column> <column> 3 </column> <column> 4 </column> <column> 5 </column> </columns-shown> <grouping> </grouping> </ETableSpecification>");
}
+static void
+message_list_setup_etable(MessageList *message_list)
+{
+ char *spec = "<ETableSpecification> <columns-shown> "
+ "<column> 0 </column> <column> 7 </column>"
+ "<column> 4 </column> <column> 5 </column> "
+ "</columns-shown> <grouping> </grouping> </ETableSpecification>";
+
+ /* build the spec based on the folder, and possibly from a saved file */
+ /* otherwise, leave default */
+ if (message_list->folder) {
+ char *name;
+ char *path;
+ struct stat st;
+
+ path = folder_to_cachename(message_list->folder, "et-header-");
+ if (stat(path, &st) == 0 && st.st_size > 0 && S_ISREG(st.st_mode)) {
+ e_table_scrolled_load_specification(E_TABLE_SCROLLED(message_list->etable), path);
+ } else {
+ /* I wonder if there's a better way to do this ...? */
+ name = camel_service_get_name((CAMEL_SERVICE(message_list->folder->parent_store)), TRUE);
+ printf("folder name is '%s'\n", name);
+ if (strstr(name, "/Drafts") == 0
+ || strstr(name, "/Outbox") == 0
+ || strstr(name, "/Sent") == 0) {
+ e_table_scrolled_set_specification(E_TABLE_SCROLLED(message_list->etable), spec);
+ }
+ g_free(name);
+ }
+ g_free(path);
+ }
+}
+
/*
* GtkObject::init
*/
@@ -997,7 +1045,7 @@ message_list_init (GtkObject *object)
GTK_SIGNAL_FUNC (on_double_click), message_list);
gtk_widget_show (message_list->etable);
-
+
gtk_object_ref (GTK_OBJECT (message_list->table_model));
gtk_object_sink (GTK_OBJECT (message_list->table_model));
@@ -1020,8 +1068,10 @@ message_list_destroy (GtkObject *object)
MessageList *message_list = MESSAGE_LIST (object);
int i;
- if (message_list->folder)
+ if (message_list->folder) {
save_tree_state(message_list);
+ save_header_state(message_list);
+ }
gtk_object_unref (GTK_OBJECT (message_list->table_model));
gtk_object_unref (GTK_OBJECT (message_list->header_model));
@@ -1425,6 +1475,9 @@ message_list_set_folder (MessageList *message_list, CamelFolder *camel_folder)
message_list->folder = camel_folder;
+ /* build the etable suitable for this folder */
+ message_list_setup_etable(message_list);
+
camel_object_hook_event(CAMEL_OBJECT (camel_folder), "folder_changed",
folder_changed, message_list);
camel_object_hook_event(CAMEL_OBJECT (camel_folder), "message_changed",