aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-03-13 05:10:12 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-03-13 05:10:12 +0800
commitfff110978aa79dcde9654c8386eb828b1c752c63 (patch)
treeb280395f967b7a532a7b36e15a7982f35723872b /mail/mail-callbacks.c
parente19514f1319263d57cb9ebf900513518b011c3b3 (diff)
downloadgsoc2013-evolution-fff110978aa79dcde9654c8386eb828b1c752c63.tar.gz
gsoc2013-evolution-fff110978aa79dcde9654c8386eb828b1c752c63.tar.zst
gsoc2013-evolution-fff110978aa79dcde9654c8386eb828b1c752c63.zip
Set the folder on a folder-browser object.
2002-03-12 Jeffrey Stedfast <fejj@ximian.com> * folder-browser.c (folder_browser_set_folder): Set the folder on a folder-browser object. * folder-browser-window.c (folder_browser_window_new): Simple window to display a folder-browser. * mail-callbacks.c (view_digest): New callback to open a folder-browser-window with a digest folder. svn path=/trunk/; revision=16127
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c60
1 files changed, 59 insertions, 1 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 5cec76bafb..37f4d352bc 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -43,6 +43,7 @@
#include <e-util/e-dialog-utils.h>
#include <filter/filter-editor.h>
#include "mail.h"
+#include "folder-browser-window.h"
#include "message-browser.h"
#include "mail-callbacks.h"
#include "mail-config.h"
@@ -3031,6 +3032,63 @@ configure_folder (BonoboUIComponent *uih, void *user_data, const char *path)
}
static void
+do_view_digest (CamelFolder *folder, char *uid, CamelMimeMessage *message, void *data)
+{
+ FolderBrowser *folder_browser = FOLDER_BROWSER (data);
+
+ if (FOLDER_BROWSER_IS_DESTROYED (folder_browser))
+ return;
+
+ if (message) {
+ CamelFolder *digest;
+ CamelStore *store;
+ FolderBrowser *fb;
+ GtkWidget *window;
+
+ store = camel_digest_store_new ("digest:/");
+
+ digest = camel_digest_folder_new (store, message);
+ camel_object_unref (CAMEL_OBJECT (store));
+ if (!digest)
+ return;
+
+ camel_folder_set_message_flags (folder, uid, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
+
+ fb = (FolderBrowser *) folder_browser_new (folder_browser->shell, NULL);
+ folder_browser_set_message_preview (fb, TRUE);
+ folder_browser_set_folder (fb, digest, "digest:/");
+ camel_object_unref (CAMEL_OBJECT (digest));
+ gtk_widget_show (GTK_WIDGET (fb));
+
+ window = folder_browser_window_new (fb);
+ gtk_widget_show (window);
+ }
+}
+
+void
+view_digest (GtkWidget *widget, gpointer user_data)
+{
+ FolderBrowser *fb = FOLDER_BROWSER (user_data);
+ GPtrArray *uids;
+ int i;
+
+ if (FOLDER_BROWSER_IS_DESTROYED (fb))
+ return;
+
+ uids = g_ptr_array_new ();
+ message_list_foreach (fb->message_list, enumerate_msg, uids);
+
+ if (uids->len > 10 && !are_you_sure (_("Are you sure you want to open all %d messages in separate windows?"), uids, fb))
+ return;
+
+ for (i = 0; i < uids->len; i++) {
+ mail_get_message (fb->folder, uids->pdata [i], do_view_digest, fb, mail_thread_queued);
+ g_free (uids->pdata [i]);
+ }
+ g_ptr_array_free (uids, TRUE);
+}
+
+static void
do_view_message (CamelFolder *folder, char *uid, CamelMimeMessage *message, void *data)
{
FolderBrowser *fb = FOLDER_BROWSER (data);
@@ -3062,7 +3120,7 @@ view_msg (GtkWidget *widget, gpointer user_data)
if (uids->len > 10 && !are_you_sure (_("Are you sure you want to open all %d messages in separate windows?"), uids, fb))
return;
-
+
for (i = 0; i < uids->len; i++) {
mail_get_message (fb->folder, uids->pdata [i], do_view_message, fb, mail_thread_queued);
g_free (uids->pdata [i]);