aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-03-19 00:52:27 +0800
committerDan Winship <danw@src.gnome.org>2002-03-19 00:52:27 +0800
commit16af96a2ab47b8f58f1c86380162e26530842868 (patch)
tree83cf70adafd65bdd70071befe20b431e3e3f34ad /composer/e-msg-composer.c
parentbc73d24d04269d1cd4df99acdb511580626ca98f (diff)
downloadgsoc2013-evolution-16af96a2ab47b8f58f1c86380162e26530842868.tar
gsoc2013-evolution-16af96a2ab47b8f58f1c86380162e26530842868.tar.gz
gsoc2013-evolution-16af96a2ab47b8f58f1c86380162e26530842868.tar.bz2
gsoc2013-evolution-16af96a2ab47b8f58f1c86380162e26530842868.tar.lz
gsoc2013-evolution-16af96a2ab47b8f58f1c86380162e26530842868.tar.xz
gsoc2013-evolution-16af96a2ab47b8f58f1c86380162e26530842868.tar.zst
gsoc2013-evolution-16af96a2ab47b8f58f1c86380162e26530842868.zip
"Forward as iCalendar" uses set_body, so we can't make the composer
* Evolution-Composer.idl, evolution-composer.c (impl_Composer_show): "Forward as iCalendar" uses set_body, so we can't make the composer un-showable after doing that. So get rid of the "cannot show" exception. * e-msg-composer.c (e_msg_composer_set_body): Prepare the composer to be shown in its weird state: Put an explanatory message in the body, then call disable_editor. (disable_editor): Common editor-disabling code - makes the editor and attachment bar insensitive and disables any menu items that could be used to modify them. (e_msg_composer_new_redirect): Use disable_editor here now. svn path=/trunk/; revision=16191
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r--composer/e-msg-composer.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 66113929d1..54cbe376ed 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -51,6 +51,7 @@
#include <sys/wait.h>
#include <unistd.h>
#include <gal/unicode/gunicode.h>
+#include <gal/util/e-unicode-i18n.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-exec.h>
#include <libgnomeui/gnome-app.h>
@@ -3191,6 +3192,16 @@ e_msg_composer_new_with_message (CamelMimeMessage *message)
return new;
}
+static void
+disable_editor (EMsgComposer *composer)
+{
+ gtk_widget_set_sensitive (composer->editor, FALSE);
+ gtk_widget_set_sensitive (composer->attachment_bar, FALSE);
+
+ bonobo_ui_component_set_prop (composer->uic, "/menu/Edit", "sensitive", "0", NULL);
+ bonobo_ui_component_set_prop (composer->uic, "/menu/Format", "sensitive", "0", NULL);
+ bonobo_ui_component_set_prop (composer->uic, "/menu/Insert", "sensitive", "0", NULL);
+}
/**
* e_msg_composer_new_redirect:
@@ -3216,8 +3227,7 @@ e_msg_composer_new_redirect (CamelMimeMessage *message, const char *resent_from)
e_msg_composer_set_headers (composer, resent_from, NULL, NULL, NULL, subject);
- gtk_widget_set_sensitive (composer->editor, FALSE);
- gtk_widget_set_sensitive (composer->attachment_bar, FALSE);
+ disable_editor (composer);
return composer;
}
@@ -3450,12 +3460,17 @@ e_msg_composer_set_body (EMsgComposer *composer, const char *body,
const char *mime_type)
{
g_return_if_fail (E_IS_MSG_COMPOSER (composer));
-
+
+ set_editor_text (composer, U_("<b>(The composer contains a non-text "
+ "message body, which cannot be "
+ "editted.)<b>"));
+ e_msg_composer_set_send_html (composer, FALSE);
+ disable_editor (composer);
+
g_free (composer->mime_body);
composer->mime_body = g_strdup (body);
g_free (composer->mime_type);
composer->mime_type = g_strdup (mime_type);
- composer->send_html = FALSE;
}