aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--composer/ChangeLog15
-rw-r--r--composer/Evolution-Composer.idl7
-rw-r--r--composer/e-msg-composer.c23
-rw-r--r--composer/evolution-composer.c7
4 files changed, 36 insertions, 16 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 4a0b381f40..c455b1a5e6 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,18 @@
+2002-03-18 Dan Winship <danw@ximian.com>
+
+ * 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.
+
2002-03-15 Radek Doulik <rodo@ximian.com>
* e-msg-composer.c: use gtkhtml editor API version 1.1
diff --git a/composer/Evolution-Composer.idl b/composer/Evolution-Composer.idl
index 543e6edd2d..5163197220 100644
--- a/composer/Evolution-Composer.idl
+++ b/composer/Evolution-Composer.idl
@@ -70,8 +70,7 @@ module Evolution {
* Sets the body of the composer to @body. If
* @mime_type is something other than "text/plain" or
* "text/html", the composer will not be editable
- * (calling show() will raise an exception), and the
- * composer will not attempt to assign a non-UTF8
+ * and it will not attempt to assign a non-UTF8
* character set to the data. However, @mime_type may
* include parameters in that case.
**/
@@ -123,9 +122,7 @@ module Evolution {
* Shows the composer and lets the user edit things
* and send the message.
**/
- exception CannotShow {};
- void show ()
- raises (CannotShow);
+ void show ();
/**
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;
}
diff --git a/composer/evolution-composer.c b/composer/evolution-composer.c
index 1630d97ce3..b6aec0af29 100644
--- a/composer/evolution-composer.c
+++ b/composer/evolution-composer.c
@@ -209,13 +209,6 @@ impl_Composer_show (PortableServer_Servant servant,
bonobo_object = bonobo_object_from_servant (servant);
composer = EVOLUTION_COMPOSER (bonobo_object);
- if (composer->composer->mime_body) {
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_GNOME_Evolution_Composer_CannotShow,
- NULL);
- return;
- }
-
gtk_widget_show (GTK_WIDGET (composer->composer));
}