aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-ops.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-04-23 02:07:14 +0800
committerDan Winship <danw@src.gnome.org>2000-04-23 02:07:14 +0800
commitf5ec554c152ece6b2cac94f030760df4b53bb1c7 (patch)
treea4e616dba27372dadf0bdc2bcbe067161885d9f4 /mail/mail-ops.c
parentee7f36f84b8f45356fae240c13dd68b0e8aee8d5 (diff)
downloadgsoc2013-evolution-f5ec554c152ece6b2cac94f030760df4b53bb1c7.tar.gz
gsoc2013-evolution-f5ec554c152ece6b2cac94f030760df4b53bb1c7.tar.zst
gsoc2013-evolution-f5ec554c152ece6b2cac94f030760df4b53bb1c7.zip
move msg_composer_cb and msg_composer_send_cb to mail-ops. Attach send,
* folder-browser-factory.c: move msg_composer_cb and msg_composer_send_cb to mail-ops. Attach send, reply, and "reply to all" buttons. * mail-ops.c (composer_send_cb, send): moved from folder-browser-factory.c. (reply_to_sender, reply_to_all): new functions to do replies. * mail-format.c (text_to_html): Add an "add_pre" flag, to make it wrap the output in <pre></pre>. (mail_generate_reply): New function to create a composer and build a reply in it. svn path=/trunk/; revision=2554
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r--mail/mail-ops.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 9a076c5856..9653b50fc6 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -31,6 +31,7 @@
#include "folder-browser.h"
#include "session.h"
#include "e-util/e-setup.h"
+#include "composer/e-msg-composer.h"
#ifndef HAVE_MKSTEMP
#include <fcntl.h>
@@ -250,3 +251,63 @@ fetch_mail (GtkWidget *button, gpointer user_data)
if (msg)
gtk_object_unref (GTK_OBJECT (msg));
}
+
+
+static void
+composer_send_cb (EMsgComposer *composer, gpointer data)
+{
+ CamelMimeMessage *message;
+ CamelStream *stream;
+ int stdout_dup;
+
+ message = e_msg_composer_get_message (composer);
+
+ stdout_dup = dup (1);
+ stream = camel_stream_fs_new_with_fd (stdout_dup);
+ camel_data_wrapper_write_to_stream (CAMEL_DATA_WRAPPER (message),
+ stream);
+ camel_stream_close (stream);
+
+ gtk_object_unref (GTK_OBJECT (message));
+ gtk_object_destroy (GTK_OBJECT (composer));
+}
+
+
+void
+send (GtkWidget *widget, gpointer user_data)
+{
+ GtkWidget *composer;
+
+ composer = e_msg_composer_new ();
+
+ gtk_signal_connect (GTK_OBJECT (composer), "send",
+ GTK_SIGNAL_FUNC (composer_send_cb), NULL);
+ gtk_widget_show (composer);
+}
+
+
+static void
+reply (FolderBrowser *fb, gboolean to_all)
+{
+ EMsgComposer *composer;
+
+ composer = mail_generate_reply (fb->mail_display->current_message,
+ to_all);
+
+ gtk_signal_connect (GTK_OBJECT (composer), "send",
+ GTK_SIGNAL_FUNC (composer_send_cb), NULL);
+
+ gtk_widget_show (GTK_WIDGET (composer));
+}
+
+void
+reply_to_sender (GtkWidget *button, gpointer user_data)
+{
+ reply (FOLDER_BROWSER (user_data), FALSE);
+}
+
+void
+reply_to_all (GtkWidget *button, gpointer user_data)
+{
+ reply (FOLDER_BROWSER (user_data), TRUE);
+}