aboutsummaryrefslogtreecommitdiffstats
path: root/mail/e-mail-reader.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-08-14 08:49:46 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-08-14 08:56:33 +0800
commit6cb0cbd0be5791aa0af1f78ce44c7a6563611d8f (patch)
tree8ac6832a905017845b3095112b83bb14da112617 /mail/e-mail-reader.c
parentcaed9460b2d518005abe34035d5b414ff07c0212 (diff)
downloadgsoc2013-evolution-6cb0cbd0be5791aa0af1f78ce44c7a6563611d8f.tar.gz
gsoc2013-evolution-6cb0cbd0be5791aa0af1f78ce44c7a6563611d8f.tar.zst
gsoc2013-evolution-6cb0cbd0be5791aa0af1f78ce44c7a6563611d8f.zip
Pass an EShell to EMsgComposer instances.
Reduce the composer's dependency on e_shell_get_default().
Diffstat (limited to 'mail/e-mail-reader.c')
-rw-r--r--mail/e-mail-reader.c49
1 files changed, 42 insertions, 7 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 5a0ef4628d..22dccb96ca 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -420,11 +420,16 @@ static void
action_mail_forward_cb (GtkAction *action,
EMailReader *reader)
{
+ EShell *shell;
+ EShellBackend *shell_backend;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
const gchar *folder_uri;
+ shell_backend = e_mail_reader_get_shell_backend (reader);
+ shell = e_shell_backend_get_shell (shell_backend);
+
folder = e_mail_reader_get_folder (reader);
folder_uri = e_mail_reader_get_folder_uri (reader);
uids = e_mail_reader_get_selected_uids (reader);
@@ -433,7 +438,7 @@ action_mail_forward_cb (GtkAction *action,
g_return_if_fail (uids != NULL);
if (em_utils_ask_open_many (window, uids->len))
- em_utils_forward_messages (folder, uids, folder_uri);
+ em_utils_forward_messages (shell, folder, uids, folder_uri);
else
em_utils_uids_free (uids);
}
@@ -442,11 +447,16 @@ static void
action_mail_forward_attached_cb (GtkAction *action,
EMailReader *reader)
{
+ EShell *shell;
+ EShellBackend *shell_backend;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
const gchar *folder_uri;
+ shell_backend = e_mail_reader_get_shell_backend (reader);
+ shell = e_shell_backend_get_shell (shell_backend);
+
folder = e_mail_reader_get_folder (reader);
folder_uri = e_mail_reader_get_folder_uri (reader);
uids = e_mail_reader_get_selected_uids (reader);
@@ -455,7 +465,7 @@ action_mail_forward_attached_cb (GtkAction *action,
g_return_if_fail (uids != NULL);
if (em_utils_ask_open_many (window, uids->len))
- em_utils_forward_attached (folder, uids, folder_uri);
+ em_utils_forward_attached (shell, folder, uids, folder_uri);
else
em_utils_uids_free (uids);
}
@@ -464,11 +474,16 @@ static void
action_mail_forward_inline_cb (GtkAction *action,
EMailReader *reader)
{
+ EShell *shell;
+ EShellBackend *shell_backend;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
const gchar *folder_uri;
+ shell_backend = e_mail_reader_get_shell_backend (reader);
+ shell = e_shell_backend_get_shell (shell_backend);
+
folder = e_mail_reader_get_folder (reader);
folder_uri = e_mail_reader_get_folder_uri (reader);
uids = e_mail_reader_get_selected_uids (reader);
@@ -477,7 +492,7 @@ action_mail_forward_inline_cb (GtkAction *action,
g_return_if_fail (uids != NULL);
if (em_utils_ask_open_many (window, uids->len))
- em_utils_forward_inline (folder, uids, folder_uri);
+ em_utils_forward_inline (shell, folder, uids, folder_uri);
else
em_utils_uids_free (uids);
}
@@ -486,11 +501,16 @@ static void
action_mail_forward_quoted_cb (GtkAction *action,
EMailReader *reader)
{
+ EShell *shell;
+ EShellBackend *shell_backend;
CamelFolder *folder;
GtkWindow *window;
GPtrArray *uids;
const gchar *folder_uri;
+ shell_backend = e_mail_reader_get_shell_backend (reader);
+ shell = e_shell_backend_get_shell (shell_backend);
+
folder = e_mail_reader_get_folder (reader);
folder_uri = e_mail_reader_get_folder_uri (reader);
uids = e_mail_reader_get_selected_uids (reader);
@@ -499,7 +519,7 @@ action_mail_forward_quoted_cb (GtkAction *action,
g_return_if_fail (uids != NULL);
if (em_utils_ask_open_many (window, uids->len))
- em_utils_forward_quoted (folder, uids, folder_uri);
+ em_utils_forward_quoted (shell, folder, uids, folder_uri);
else
em_utils_uids_free (uids);
}
@@ -601,24 +621,34 @@ static void
action_mail_message_edit_cb (GtkAction *action,
EMailReader *reader)
{
+ EShell *shell;
+ EShellBackend *shell_backend;
CamelFolder *folder;
GPtrArray *uids;
+ shell_backend = e_mail_reader_get_shell_backend (reader);
+ shell = e_shell_backend_get_shell (shell_backend);
+
folder = e_mail_reader_get_folder (reader);
uids = e_mail_reader_get_selected_uids (reader);
- em_utils_edit_messages (folder, uids, FALSE);
+ em_utils_edit_messages (shell, folder, uids, FALSE);
}
static void
action_mail_message_new_cb (GtkAction *action,
EMailReader *reader)
{
+ EShell *shell;
+ EShellBackend *shell_backend;
const gchar *folder_uri;
+ shell_backend = e_mail_reader_get_shell_backend (reader);
+ shell = e_shell_backend_get_shell (shell_backend);
+
folder_uri = e_mail_reader_get_folder_uri (reader);
- em_utils_compose_new_message (folder_uri);
+ em_utils_compose_new_message (shell, folder_uri);
}
static void
@@ -867,17 +897,22 @@ static void
action_mail_redirect_cb (GtkAction *action,
EMailReader *reader)
{
+ EShell *shell;
+ EShellBackend *shell_backend;
GtkWidget *message_list;
CamelFolder *folder;
const gchar *uid;
+ shell_backend = e_mail_reader_get_shell_backend (reader);
+ shell = e_shell_backend_get_shell (shell_backend);
+
folder = e_mail_reader_get_folder (reader);
message_list = e_mail_reader_get_message_list (reader);
uid = MESSAGE_LIST (message_list)->cursor_uid;
g_return_if_fail (uid != NULL);
- em_utils_redirect_message_by_uid (folder, uid);
+ em_utils_redirect_message_by_uid (shell, folder, uid);
}
static void