aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mail/e-mail-shell-view.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-10-28 21:06:15 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-10-28 21:47:57 +0800
commit1cd5fb6de35c30eb1965c9847a808aefac325778 (patch)
tree48e4f26c7017fcc44512d6371a06823a4804ec0f /modules/mail/e-mail-shell-view.c
parentb89a9ae09da810024655a87e5c466c2b171a47b4 (diff)
downloadgsoc2013-evolution-1cd5fb6de35c30eb1965c9847a808aefac325778.tar.gz
gsoc2013-evolution-1cd5fb6de35c30eb1965c9847a808aefac325778.tar.zst
gsoc2013-evolution-1cd5fb6de35c30eb1965c9847a808aefac325778.zip
Don't update the message list when right-clicking on a folder.
After the folder's context menu closes the folder tree selection jumps back to the folder whose contents are showing in the message list. Suggested by Philippe LeCavalier on evolution-list.
Diffstat (limited to 'modules/mail/e-mail-shell-view.c')
-rw-r--r--modules/mail/e-mail-shell-view.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c
index d331c080ed..7ce6833463 100644
--- a/modules/mail/e-mail-shell-view.c
+++ b/modules/mail/e-mail-shell-view.c
@@ -399,11 +399,12 @@ static void
mail_shell_view_update_actions (EShellView *shell_view)
{
EMailShellView *mail_shell_view;
+ EMailShellContent *mail_shell_content;
EMailShellSidebar *mail_shell_sidebar;
- EShellContent *shell_content;
EShellSidebar *shell_sidebar;
EShellWindow *shell_window;
EMFolderTree *folder_tree;
+ EMailReader *reader;
EAccount *account = NULL;
GtkAction *action;
const gchar *label;
@@ -420,13 +421,15 @@ mail_shell_view_update_actions (EShellView *shell_view)
gboolean folder_is_store;
gboolean folder_is_trash;
gboolean folder_has_unread_rec = FALSE;
+ gboolean folder_tree_and_message_list_agree = TRUE;
mail_shell_view = E_MAIL_SHELL_VIEW (shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
- shell_content = e_shell_view_get_shell_content (shell_view);
- e_mail_reader_update_actions (E_MAIL_READER (shell_content));
+ mail_shell_content = mail_shell_view->priv->mail_shell_content;
+ reader = E_MAIL_READER (mail_shell_content);
+ e_mail_reader_update_actions (reader);
mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
@@ -450,6 +453,18 @@ mail_shell_view_update_actions (EShellView *shell_view)
uri = em_folder_tree_get_selected_uri (folder_tree);
if (uri != NULL) {
EMFolderTreeModel *model;
+ MessageList *message_list;
+
+ /* XXX If the user right-clicks on a folder other than what
+ * the message list is showing, disable folder rename.
+ * Between fetching the CamelFolder asynchronously and
+ * knowing when NOT to move the folder tree selection
+ * back to where it was to avoid cancelling the inline
+ * folder tree editing, it's just too hairy to try to
+ * get right. So we're punting. */
+ message_list = e_mail_reader_get_message_list (reader);
+ folder_tree_and_message_list_agree =
+ (g_strcmp0 (uri, message_list->folder_uri) == 0);
account = mail_config_get_account_by_source_url (uri);
@@ -516,7 +531,9 @@ mail_shell_view_update_actions (EShellView *shell_view)
gtk_action_set_sensitive (action, sensitive);
action = ACTION (MAIL_FOLDER_RENAME);
- sensitive = !folder_is_store && folder_can_be_deleted;
+ sensitive =
+ !folder_is_store && folder_can_be_deleted &&
+ folder_tree_and_message_list_agree;
gtk_action_set_sensitive (action, sensitive);
action = ACTION (MAIL_FOLDER_UNSUBSCRIBE);