diff options
author | Srinivasa Ragavan <sragavan@novell.com> | 2006-01-16 16:18:31 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2006-01-16 16:18:31 +0800 |
commit | 16ffb753b859465e7901b4272f01837e98c0865b (patch) | |
tree | 888c57409300388360499e3a945982656d6b3564 /mail/message-list.c | |
parent | ef3ea1d41b2163f838c205f3c8aee071ffdaafe1 (diff) | |
download | gsoc2013-evolution-16ffb753b859465e7901b4272f01837e98c0865b.tar gsoc2013-evolution-16ffb753b859465e7901b4272f01837e98c0865b.tar.gz gsoc2013-evolution-16ffb753b859465e7901b4272f01837e98c0865b.tar.bz2 gsoc2013-evolution-16ffb753b859465e7901b4272f01837e98c0865b.tar.lz gsoc2013-evolution-16ffb753b859465e7901b4272f01837e98c0865b.tar.xz gsoc2013-evolution-16ffb753b859465e7901b4272f01837e98c0865b.tar.zst gsoc2013-evolution-16ffb753b859465e7901b4272f01837e98c0865b.zip |
** Fixes bug #218570
2006-01-16 Srinivasa Ragavan <sragavan@novell.com>
** Fixes bug #218570
* em-folder-browser.c (emfb_expand_all_threads),
(emfb_collapse_all_threads), (emfb_set_folder), (emfb_activate):
Added code to handle expande/collapse all and call e-tree for regen of
the list.
* message-list.c (load_tree_expand_all),
(message_list_set_threaded_expand_all),
(message_list_set_threaded_collapse_all),
(message_list_set_expand_all), (regen_list_regened): Added code to
conditionally check for expand/collapse all and save the state after
the operation.
* message-list.h: Added state variable for expand/collapse all of
threads.
svn path=/trunk/; revision=31204
Diffstat (limited to 'mail/message-list.c')
-rw-r--r-- | mail/message-list.c | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/mail/message-list.c b/mail/message-list.c index f95624ee04..ef42be46e6 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -1479,6 +1479,16 @@ save_tree_state(MessageList *ml) } static void +load_tree_expand_all (MessageList *ml, gboolean state) +{ + + if (ml->folder == NULL || ml->tree == NULL) + return; + + e_tree_load_all_expanded_state (ml->tree, state); + save_tree_state (ml); +} +static void load_tree_state (MessageList *ml) { char *filename; @@ -3102,6 +3112,28 @@ void message_list_free_uids(MessageList *ml, GPtrArray *uids) } /* set whether we are in threaded view or flat view */ +void +message_list_set_threaded_expand_all (MessageList *ml) +{ + if (ml->threaded) { + ml->expand_all = 1; + + if (ml->frozen == 0) + mail_regen_list (ml, ml->search, NULL, NULL); + } +} + +void +message_list_set_threaded_collapse_all (MessageList *ml) +{ + if (ml->threaded) { + ml->collapse_all = 1; + + if (ml->frozen == 0) + mail_regen_list (ml, ml->search, NULL, NULL); + } +} + void message_list_set_threaded (MessageList *ml, gboolean threaded) { @@ -3114,6 +3146,17 @@ message_list_set_threaded (MessageList *ml, gboolean threaded) } void +message_list_set_expand_all (MessageList *ml, gboolean threaded) +{ + if (ml->threaded != threaded) { + ml->threaded = threaded; + + if (ml->frozen == 0) + mail_regen_list (ml, ml->search, NULL, NULL); + } +} + +void message_list_set_hidedeleted (MessageList *ml, gboolean hidedeleted) { if (ml->hidedeleted != hidedeleted) { @@ -3596,7 +3639,15 @@ regen_list_regened (struct _mail_msg *mm) m->ml->thread_tree = m->tree; m->tree = NULL; - load_tree_state (m->ml); + if (m->ml->expand_all) + load_tree_expand_all (m->ml, TRUE); + else if (m->ml->collapse_all) + load_tree_expand_all (m->ml, FALSE); + else + load_tree_state (m->ml); + + m->ml->expand_all = FALSE; + m->ml->collapse_all = FALSE; } else build_flat (m->ml, m->summary, m->changes); |