diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-08-08 10:08:44 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-08-08 10:08:44 +0800 |
commit | 573ea91f0c6dc6de73884bbf1a4b039975fcacda (patch) | |
tree | bdfab5a98b22e1253d7864cf70528360add0fb62 /mail/mail-ops.c | |
parent | 5428d055d162ffa0dde2b0dc5a9b2e6907a6ca73 (diff) | |
download | gsoc2013-evolution-573ea91f0c6dc6de73884bbf1a4b039975fcacda.tar.gz gsoc2013-evolution-573ea91f0c6dc6de73884bbf1a4b039975fcacda.tar.zst gsoc2013-evolution-573ea91f0c6dc6de73884bbf1a4b039975fcacda.zip |
Added mail-view.c
2000-08-07 Jeffrey Stedfast <fejj@helixcode.com>
* Makefile.am: Added mail-view.c
* folder-browser-factory.c (control_activate): Adda menu item for
viewing the message
* mail-view.c: New file containing methods for viewing messages in
separate windows
* mail-ops.c (view_message): New callback for viewing messages in
a new window.
svn path=/trunk/; revision=4588
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 41211d20ea..768856a6f3 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1028,3 +1028,47 @@ print_msg (GtkWidget *button, gpointer user_data) gtk_object_unref (GTK_OBJECT (print_master)); } + +struct view_msg_data { + FolderBrowser *fb; + CamelException *ex; +}; + +static void +real_view_msg (MessageList *ml, const char *uid, gpointer user_data) +{ + struct view_msg_data *data = user_data; + CamelMimeMessage *msg; + GtkWidget *view; + + if (camel_exception_is_set (data->ex)) + return; + + msg = camel_folder_get_message (ml->folder, uid, data->ex); + + view = mail_view_create (msg, data->fb); + + gtk_widget_show (view); +} + +void +view_message (BonoboUIHandler *uih, void *user_data, const char *path) +{ + struct view_msg_data data; + FolderBrowser *fb = user_data; + CamelException ex; + MessageList *ml; + + camel_exception_init (&ex); + + data.fb = fb; + data.ex = &ex; + + ml = fb->message_list; + message_list_foreach (ml, real_view_msg, &data); + if (camel_exception_is_set (&ex)) { + mail_exception_dialog ("Could not open message for viewing", &ex, fb); + camel_exception_clear (&ex); + return; + } +} |