diff options
Diffstat (limited to 'mail/e-mail-shell-view-private.c')
-rw-r--r-- | mail/e-mail-shell-view-private.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/mail/e-mail-shell-view-private.c b/mail/e-mail-shell-view-private.c index 9287ed777e..21521fd0f9 100644 --- a/mail/e-mail-shell-view-private.c +++ b/mail/e-mail-shell-view-private.c @@ -24,6 +24,32 @@ #include <widgets/menus/gal-view-factory-etable.h> static void +mail_shell_view_folder_tree_selected_cb (EMailShellView *mail_shell_view, + const gchar *full_name, + const gchar *uri, + guint32 flags, + EMFolderTree *folder_tree) +{ + EMailShellContent *mail_shell_content; + EMFolderView *folder_view; + + mail_shell_content = mail_shell_view->priv->mail_shell_content; + folder_view = e_mail_shell_content_get_folder_view (mail_shell_content); + + if ((flags & CAMEL_FOLDER_NOSELECT) || full_name == NULL) + em_folder_view_set_folder (folder_view, NULL, NULL); + else { + EMFolderTreeModel *model; + + model = em_folder_tree_get_model (folder_tree); + em_folder_tree_model_set_selected (model, uri); + em_folder_tree_model_save_state (model); + + em_folder_view_set_folder_uri (folder_view, uri); + } +} + +static void mail_shell_view_folder_tree_popup_event_cb (EShellView *shell_view, GdkEventButton *event) { @@ -121,6 +147,11 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar); g_signal_connect_swapped ( + folder_tree, "folder-selected", + G_CALLBACK (mail_shell_view_folder_tree_selected_cb), + mail_shell_view); + + g_signal_connect_swapped ( folder_tree, "popup-event", G_CALLBACK (mail_shell_view_folder_tree_popup_event_cb), mail_shell_view); |