diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-04-13 22:31:24 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-06-03 11:00:40 +0800 |
commit | 992373c8b0ac5ab0fe8ad495577a5a7a4a57b0b0 (patch) | |
tree | c8a15e9bfbd44a7e8263337a68b328abf3692666 /modules/mail/e-mail-shell-view-actions.c | |
parent | 26e7480340ff1bcdeed3692b5046e4d735f185b1 (diff) | |
download | gsoc2013-evolution-992373c8b0ac5ab0fe8ad495577a5a7a4a57b0b0.tar.gz gsoc2013-evolution-992373c8b0ac5ab0fe8ad495577a5a7a4a57b0b0.tar.zst gsoc2013-evolution-992373c8b0ac5ab0fe8ad495577a5a7a4a57b0b0.zip |
Adapt modules/mail to the new ESource API.
Diffstat (limited to 'modules/mail/e-mail-shell-view-actions.c')
-rw-r--r-- | modules/mail/e-mail-shell-view-actions.c | 60 |
1 files changed, 51 insertions, 9 deletions
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c index 5de1e509fb..afe347cae6 100644 --- a/modules/mail/e-mail-shell-view-actions.c +++ b/modules/mail/e-mail-shell-view-actions.c @@ -118,9 +118,12 @@ action_mail_account_properties_cb (GtkAction *action, EMailShellView *mail_shell_view) { EMailShellSidebar *mail_shell_sidebar; + EShell *shell; EShellView *shell_view; EShellWindow *shell_window; EShellBackend *shell_backend; + ESourceRegistry *registry; + ESource *source; EMFolderTree *folder_tree; CamelService *service; CamelStore *store; @@ -131,6 +134,7 @@ action_mail_account_properties_cb (GtkAction *action, shell_view = E_SHELL_VIEW (mail_shell_view); shell_backend = e_shell_view_get_shell_backend (shell_view); shell_window = e_shell_view_get_shell_window (shell_view); + shell = e_shell_backend_get_shell (shell_backend); folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar); store = em_folder_tree_get_selected_store (folder_tree); @@ -138,11 +142,15 @@ action_mail_account_properties_cb (GtkAction *action, service = CAMEL_SERVICE (store); uid = camel_service_get_uid (service); - + registry = e_shell_get_registry (shell); + source = e_source_registry_ref_source (registry, uid); + g_return_if_fail (source != NULL); + e_mail_shell_backend_edit_account ( E_MAIL_SHELL_BACKEND (shell_backend), - GTK_WINDOW (shell_window), - e_get_account_by_uid (uid)); + GTK_WINDOW (shell_window), source); + + g_object_unref (source); } static void @@ -841,24 +849,58 @@ static void action_mail_send_receive_cb (GtkAction *action, EMailShellView *mail_shell_view) { - e_mail_shell_view_send_receive ( - mail_shell_view, E_MAIL_SEND_RECEIVE_BOTH, NULL); + EShellView *shell_view; + EShellWindow *shell_window; + EShellBackend *shell_backend; + EMailBackend *backend; + EMailSession *session; + + shell_view = E_SHELL_VIEW (mail_shell_view); + shell_window = e_shell_view_get_shell_window (shell_view); + shell_backend = e_shell_view_get_shell_backend (shell_view); + + backend = E_MAIL_BACKEND (shell_backend); + session = e_mail_backend_get_session (backend); + + mail_send_receive (GTK_WINDOW (shell_window), session); } static void action_mail_send_receive_receive_all_cb (GtkAction *action, EMailShellView *mail_shell_view) { - e_mail_shell_view_send_receive ( - mail_shell_view, E_MAIL_SEND_RECEIVE_RECEIVE, NULL); + EShellView *shell_view; + EShellWindow *shell_window; + EShellBackend *shell_backend; + EMailBackend *backend; + EMailSession *session; + + shell_view = E_SHELL_VIEW (mail_shell_view); + shell_window = e_shell_view_get_shell_window (shell_view); + shell_backend = e_shell_view_get_shell_backend (shell_view); + + backend = E_MAIL_BACKEND (shell_backend); + session = e_mail_backend_get_session (backend); + + mail_receive (GTK_WINDOW (shell_window), session); } static void action_mail_send_receive_send_all_cb (GtkAction *action, EMailShellView *mail_shell_view) { - e_mail_shell_view_send_receive ( - mail_shell_view, E_MAIL_SEND_RECEIVE_SEND, NULL); + EShellView *shell_view; + EShellBackend *shell_backend; + EMailBackend *backend; + EMailSession *session; + + shell_view = E_SHELL_VIEW (mail_shell_view); + shell_backend = e_shell_view_get_shell_backend (shell_view); + + backend = E_MAIL_BACKEND (shell_backend); + session = e_mail_backend_get_session (backend); + + mail_send (session); } static void |