From e3f8e22df0178b8c471f0a4f6e57ac76d1f1c36c Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Sun, 23 Jul 2000 13:55:13 +0000 Subject: Add a "Send HTML mail" toggle in the message composer. svn path=/trunk/; revision=4284 --- mail/ChangeLog | 5 +++++ mail/mail-ops.c | 37 ++++++++++++++++++++++++++++++++++--- 2 files changed, 39 insertions(+), 3 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index b00f4e3086..5fff503a98 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,10 @@ 2000-07-23 Ettore Perazzoli + * mail-ops.c (create_message_composer): New. + (compose_msg): Use it. + (send_to_url): Likewise. + (forward_msg): Likewise. + * folder-browser-factory.c (control_activate): Use `_()' instead of `N_()'. diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 94cd42fae0..c28564aad8 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -568,6 +568,37 @@ free_psd (GtkWidget *composer, gpointer user_data) g_free (psd); } +static GtkWidget * +create_msg_composer (const char *url) +{ + GtkWidget *composer_widget; + gboolean send_html; + char *path; + char *string; + + path = g_strdup_printf ("=%s/config=/mail/msg_format", evolution_dir); + string = gnome_config_get_string (path); + g_free (path); + + if (string == NULL) { + send_html = FALSE; + } else { + if (!strcasecmp(string, "plain")) + send_html = FALSE; + else + send_html = TRUE; + } + + if (url != NULL) + composer_widget = e_msg_composer_new_from_url (url); + else + composer_widget = e_msg_composer_new (); + + e_msg_composer_set_send_html (E_MSG_COMPOSER (composer_widget), send_html); + + return composer_widget; +} + void compose_msg (GtkWidget *widget, gpointer user_data) { @@ -576,7 +607,7 @@ compose_msg (GtkWidget *widget, gpointer user_data) if (!check_configured ()) return; - composer = e_msg_composer_new (); + composer = create_msg_composer (NULL); gtk_signal_connect (GTK_OBJECT (composer), "send", GTK_SIGNAL_FUNC (composer_send_cb), NULL); @@ -592,7 +623,7 @@ send_to_url (const char *url) if (!check_configured ()) return; - composer = e_msg_composer_new_from_url (url); + composer = create_msg_composer (url); gtk_signal_connect (GTK_OBJECT (composer), "send", GTK_SIGNAL_FUNC (composer_send_cb), NULL); @@ -681,7 +712,7 @@ forward_msg (GtkWidget *button, gpointer user_data) if (!check_configured () || !cursor_msg) return; - composer = E_MSG_COMPOSER (e_msg_composer_new ()); + composer = E_MSG_COMPOSER (create_msg_composer (NULL)); message_list_foreach (fb->message_list, attach_msg, composer); from = camel_mime_message_get_from (cursor_msg); -- cgit