aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorRadek Doulik <rodo@src.gnome.org>2002-07-27 04:56:40 +0800
committerRadek Doulik <rodo@src.gnome.org>2002-07-27 04:56:40 +0800
commitf17d22edd03a8d209021f32bf543d21597f8bc77 (patch)
tree76585d479cb24d9b93a2c914d1d49faa3556679c /composer
parent435f2e3e58a73338422f40c7c98638b024b03550 (diff)
downloadgsoc2013-evolution-f17d22edd03a8d209021f32bf543d21597f8bc77.tar.gz
gsoc2013-evolution-f17d22edd03a8d209021f32bf543d21597f8bc77.tar.zst
gsoc2013-evolution-f17d22edd03a8d209021f32bf543d21597f8bc77.zip
(set_signature_gui): new helper method to set signature from draft
message (e_msg_composer_new_with_message): use set_signature_gui svn path=/trunk/; revision=17621
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog3
-rw-r--r--composer/e-msg-composer.c38
2 files changed, 40 insertions, 1 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index dd212d2cc6..dc3f9798f0 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -2,6 +2,9 @@
* e-msg-composer.c (do_exit): don't assert on default, when ESC is
pressed, the dialog is closed as well and we get button number -1
+ (set_signature_gui): new helper method to set signature from draft
+ message
+ (e_msg_composer_new_with_message): use set_signature_gui
2002-07-26 Ettore Perazzoli <ettore@ximian.com>
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 426830d0e7..b9effd4899 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -3210,6 +3210,42 @@ handle_multipart (EMsgComposer *composer, CamelMultipart *multipart, int depth)
}
}
+static void
+set_signature_gui (EMsgComposer *composer)
+{
+ CORBA_Environment ev;
+
+ composer->auto_signature = FALSE;
+ composer->signature = NULL;
+
+ CORBA_exception_init (&ev);
+ if (GNOME_GtkHTML_Editor_Engine_searchByData (composer->editor_engine, 1, "ClueFlow", "signature", "1", &ev)) {
+ gchar *str = NULL;
+
+ str = GNOME_GtkHTML_Editor_Engine_getParagraphData (composer->editor_engine, "signature_name", &ev);
+ if (ev._major == CORBA_NO_EXCEPTION && str) {
+ if (!strncmp (str, "name:", 5)) {
+ GList *list = NULL;
+
+ list = mail_config_get_signature_list ();
+ if (list)
+ for (; list; list = list->next) {
+ if (!strcmp (str + 5, ((MailConfigSignature *) list->data)->name))
+ break;
+ }
+ if (list)
+ composer->signature = (MailConfigSignature *) list->data;
+ else
+ composer->auto_signature = TRUE;
+ } else if (!strcmp (str, "auto")) {
+ composer->auto_signature = TRUE;
+ }
+ }
+ sig_select_item (composer);
+ }
+ CORBA_exception_free (&ev);
+}
+
/**
* e_msg_composer_new_with_message:
@@ -3371,7 +3407,7 @@ e_msg_composer_new_with_message (CamelMimeMessage *message)
*/
e_msg_composer_flush_pending_body (new, TRUE);
- set_editor_signature (new);
+ set_signature_gui (new);
return new;
}