[evolution] Copy folder tree state of 1st window when opening new windows.



commit 3d7193ad9d38264298d2767772ee57da12574c79
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Sep 3 18:53:08 2009 -0400

    Copy folder tree state of 1st window when opening new windows.

 modules/mail/e-mail-shell-sidebar.c      |    4 +---
 modules/mail/e-mail-shell-view-private.c |    5 +++++
 2 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c
index b45e30d..7d98f74 100644
--- a/modules/mail/e-mail-shell-sidebar.c
+++ b/modules/mail/e-mail-shell-sidebar.c
@@ -465,9 +465,7 @@ mail_shell_sidebar_constructed (GObject *object)
 	selection = gtk_tree_view_get_selection (tree_view);
 	model = gtk_tree_view_get_model (tree_view);
 
-	if (em_folder_tree_model_get_selection (
-		EM_FOLDER_TREE_MODEL (model)) == NULL)
-		mail_shell_sidebar_restore_state (mail_shell_sidebar);
+	mail_shell_sidebar_restore_state (mail_shell_sidebar);
 
 	em_folder_tree_model_set_selection (
 		EM_FOLDER_TREE_MODEL (model), selection);
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c
index 984c3ac..849efe6 100644
--- a/modules/mail/e-mail-shell-view-private.c
+++ b/modules/mail/e-mail-shell-view-private.c
@@ -313,6 +313,7 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view)
 	EMFolderTree *folder_tree;
 	RuleContext *context;
 	FilterRule *rule = NULL;
+	GtkTreeSelection *selection;
 	GtkTreeModel *tree_model;
 	GtkUIManager *ui_manager;
 	MessageList *message_list;
@@ -353,6 +354,7 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view)
 
 	mail_shell_sidebar = E_MAIL_SHELL_SIDEBAR (shell_sidebar);
 	folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
+	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (folder_tree));
 
 	html = EM_FORMAT_HTML (html_display)->html;
 
@@ -442,6 +444,9 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view)
 		priv->search_rules[ii++] = g_object_ref (rule);
 	}
 	g_assert (ii == MAIL_NUM_SEARCH_RULES);
+
+	/* Now that we're all set up, simulate selecting a folder. */
+	g_signal_emit_by_name (selection, "changed");
 }
 
 void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]