[evolution] Bug #596027: In Anjal, although invalid mail address warning popup, mail's tab closed automatically



commit df1f9b3b33de886c5b9a63b0ee6e722bfea4b2e0
Author: Yan Li <yanli infradead org>
Date:   Thu Nov 5 11:50:34 2009 +0800

    Bug #596027: In Anjal, although invalid mail address warning popup, mail's tab closed automatically
    
    A new field "mail_sent" is added to the Composer to indicate whether the
    mail is sent successfully or not. This is needed by Anjal to know
    whether it can destroy the composer or not.

 composer/e-composer-private.c |    4 ++++
 composer/e-composer-private.h |    9 +++++++++
 composer/e-msg-composer.c     |   14 ++++++++++++++
 composer/e-msg-composer.h     |    3 +++
 mail/em-composer-utils.c      |    3 +++
 5 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index 88a9454..0ec579f 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
 /*
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -276,6 +278,8 @@ e_composer_private_init (EMsgComposer *composer)
 			header, "visible",
 			action, "active");
 	}
+
+	priv->mail_sent = FALSE;
 }
 
 void
diff --git a/composer/e-composer-private.h b/composer/e-composer-private.h
index 3288f0b..71ced95 100644
--- a/composer/e-composer-private.h
+++ b/composer/e-composer-private.h
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
 /*
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -114,6 +116,13 @@ struct _EMsgComposerPrivate {
 	CamelMimeMessage *redirect;
 
 	gboolean is_from_message;
+
+	/* The mail composed has been sent. This bit will be set when
+	  the mail passed sanity checking and is sent out, which
+	  indicates that the composer can be destroyed. This bit can
+	  be set/get by using API
+	  e_msg_composer_{set,get}_mail_sent(). */
+	gboolean mail_sent;
 };
 
 void		e_composer_private_init		(EMsgComposer *composer);
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 7bf67a4..ffd81a0 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -4165,3 +4165,17 @@ e_save_spell_languages (GList *spell_languages)
 		g_error_free (error);
 	}
 }
+
+void e_msg_composer_set_mail_sent (EMsgComposer *composer, gboolean mail_sent)
+{
+	g_return_val_if_fail (composer != NULL, FALSE);
+
+	composer->priv->mail_sent = mail_sent;
+}
+
+gboolean e_msg_composer_get_mail_sent (EMsgComposer *composer)
+{
+	g_return_val_if_fail (composer != NULL, FALSE);
+
+	return composer->priv->mail_sent;
+}
diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h
index ab30093..e0d118b 100644
--- a/composer/e-msg-composer.h
+++ b/composer/e-msg-composer.h
@@ -151,6 +151,9 @@ GByteArray *	e_msg_composer_get_raw_message_text
 GList *		e_load_spell_languages		(void);
 void		e_save_spell_languages		(GList *spell_languages);
 
+void		e_msg_composer_set_mail_sent 	(EMsgComposer *composer, gboolean mail_sent);
+gboolean	e_msg_composer_get_mail_sent 	(EMsgComposer *composer);
+
 G_END_DECLS
 
 #endif /* E_MSG_COMPOSER_H */
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index f03a66d..60b795a 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -1,3 +1,5 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+
 /*
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -469,6 +471,7 @@ em_utils_composer_send_cb (EMsgComposer *composer)
 	camel_object_ref (folder);
 
 	/* mail the message */
+	e_msg_composer_set_mail_sent (composer, TRUE);
 	info = camel_message_info_new (NULL);
 	camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN, ~0);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]