aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/ChangeLog9
-rw-r--r--composer/e-msg-composer.c32
2 files changed, 30 insertions, 11 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 48eecc9d5e..94335c27f4 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,12 @@
+2004-01-28 Not Zed <NotZed@Ximian.com>
+
+ ** See Bug #53176, probably fixes others too.
+
+ * e-msg-composer.c (set_editor_text): When we set the text, always
+ add the signature implictly. Means we don't have to set it
+ manually and break changing the file, or hit any races.
+ (e_msg_composer_set_body_text): dont call show_sig_file here.
+
2004-01-14 Not Zed <NotZed@Ximian.com>
** See Bug #20017.
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 8b69751eae..96b551a78d 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1084,7 +1084,9 @@ set_editor_text (EMsgComposer *composer, const char *text)
BonoboWidget *editor;
CORBA_Environment ev;
Bonobo_Unknown object;
-
+ char *sig, *mem = NULL, *content;
+ size_t len;
+
g_return_if_fail (composer->persist_stream_interface != CORBA_OBJECT_NIL);
persist = composer->persist_stream_interface;
@@ -1092,8 +1094,22 @@ set_editor_text (EMsgComposer *composer, const char *text)
editor = BONOBO_WIDGET (composer->editor);
CORBA_exception_init (&ev);
-
- stream = bonobo_stream_mem_create (text, strlen (text), TRUE, FALSE);
+
+ /* This copying bullshit is because the bonobo stream interface is just painful */
+ sig = get_signature_html(composer);
+ len = strlen(text);
+ if (sig) {
+ len += strlen(sig);
+ content = mem = g_malloc(len+1);
+ memcpy(mem, text, strlen(text));
+ strcpy(mem + strlen(text), sig);
+ } else {
+ content = text;
+ }
+
+ stream = bonobo_stream_mem_create(content, len, TRUE, FALSE);
+ g_free(mem);
+
object = bonobo_object_corba_objref (BONOBO_OBJECT (stream));
Bonobo_PersistStream_load (persist, (Bonobo_Stream) object, "text/html", &ev);
if (ev._major != CORBA_NO_EXCEPTION) {
@@ -2866,7 +2882,7 @@ map_default_cb (EMsgComposer *composer, gpointer user_data)
CORBA_Environment ev;
const char *subject;
char *text;
-
+
/* If the 'To:' field is empty, focus it (This is ridiculously complicated) */
widget = e_msg_composer_hdrs_get_to_entry (E_MSG_COMPOSER_HDRS (composer->hdrs));
@@ -3177,7 +3193,6 @@ create_composer (int visible_mask)
gtk_widget_show (composer->editor);
e_msg_composer_show_attachments (composer, FALSE);
-
prepare_engine (composer);
if (composer->editor_engine == CORBA_OBJECT_NIL) {
e_activation_failure_dialog (GTK_WINDOW (composer),
@@ -3190,7 +3205,7 @@ create_composer (int visible_mask)
}
setup_cut_copy_paste (composer);
-
+
g_signal_connect (composer, "map", (GCallback) map_default_cb, NULL);
if (am == NULL)
@@ -4185,13 +4200,8 @@ e_msg_composer_set_body_text (EMsgComposer *composer, const char *text)
g_return_if_fail (E_IS_MSG_COMPOSER (composer));
set_editor_text (composer, text);
-
- /* set editor text unfortunately kills the signature so we
- have to re-show it */
- e_msg_composer_show_sig_file (composer);
}
-
/**
* e_msg_composer_set_body:
* @composer: a composer object