aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mail/e-mail-shell-view-private.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-private.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-private.c')
-rw-r--r--modules/mail/e-mail-shell-view-private.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c
index dd124f43c6..d28de5a3b1 100644
--- a/modules/mail/e-mail-shell-view-private.c
+++ b/modules/mail/e-mail-shell-view-private.c
@@ -95,13 +95,52 @@ exit:
}
static void
+mail_shell_view_folder_tree_selection_done_cb (EMailShellView *mail_shell_view,
+ GtkWidget *menu)
+{
+ EMailShellSidebar *mail_shell_sidebar;
+ EMFolderTree *folder_tree;
+ MessageList *message_list;
+ EMailReader *reader;
+ const gchar *list_uri;
+ gchar *tree_uri;
+
+ reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content);
+ message_list = e_mail_reader_get_message_list (reader);
+
+ mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
+ folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
+
+ list_uri = message_list->folder_uri;
+ tree_uri = em_folder_tree_get_selected_uri (folder_tree);
+
+ /* If the folder tree and message list disagree on the current
+ * folder, reset the folder tree to match the message list. */
+ if (g_strcmp0 (tree_uri, list_uri) != 0)
+ em_folder_tree_set_selected (folder_tree, list_uri, FALSE);
+
+ g_free (tree_uri);
+
+ /* Disconnect from the "selection-done" signal. */
+ g_signal_handlers_disconnect_by_func (
+ menu, mail_shell_view_folder_tree_selection_done_cb,
+ mail_shell_view);
+}
+
+static void
mail_shell_view_folder_tree_popup_event_cb (EShellView *shell_view,
GdkEventButton *event)
{
+ GtkWidget *menu;
const gchar *widget_path;
widget_path = "/mail-folder-popup";
- e_shell_view_show_popup_menu (shell_view, widget_path, event);
+ menu = e_shell_view_show_popup_menu (shell_view, widget_path, event);
+
+ g_signal_connect_swapped (
+ menu, "selection-done",
+ G_CALLBACK (mail_shell_view_folder_tree_selection_done_cb),
+ shell_view);
}
static gboolean