[anjal/anjal-0-1] BUGFIX: GNOME Bug #599792 - Anjal composer's Send button doesn't work after pressed Save Drafts butt



commit 11eb2472f4f7cdb667c200a3f9a51b2f18c85dc4
Author: Yan Li <yanli infradead org>
Date:   Fri Nov 6 16:39:37 2009 +0800

    BUGFIX: GNOME Bug #599792 - Anjal composer's Send button doesn't work after pressed Save Drafts button
    
    This patch depends on commit 08150f6 of Evolution/gnome-2-28.
    
    This bug is due to an old hack in Evolution that hiding a composer
    means we're closing it so save_draft_done() destroys the composer
    after saved draft. But in Anjal, the composer widget is always hidden
    (since the editor is reparented to the tab), and will be wrongly
    destroyed by save_draft_done() when you clicked "Save Draft" button.
    
    A new API function, e_msg_composer_request_close(), was added to
    Evolution composer for requesting close a composer so we no longer use
    its visibility to decide whether to destroy it or not.
    (cherry picked from commit 9493524d831e76b1c0563336168bd590d68daca8)

 src/mail-composer-view.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/mail-composer-view.c b/src/mail-composer-view.c
index 29496c2..aab908c 100644
--- a/src/mail-composer-view.c
+++ b/src/mail-composer-view.c
@@ -178,6 +178,7 @@ mail_composer_view_construct (MailComposerView *shell, struct _EMsgComposer *new
 
 	table = e_msg_composer_get_header_table (composer);	
 	e_composer_header_table_set_header_visible (table, E_COMPOSER_HEADER_FROM, FALSE);
+	/* steal the composer's vbox */
 	tmp = g_object_get_data((GObject *)composer, "vbox");
 	gtk_widget_reparent (tmp, box);
 	priv->box = box;
@@ -267,9 +268,10 @@ mail_composer_view_can_quit (MailComposerView *mcv)
 		if (subject == NULL || *subject == '\0')
 			subject = _("Untitled Message");
 		response = e_error_run (GTK_WINDOW (composer), "mail-composer:exit-unsaved", subject, NULL);
-		if (response ==  GTK_RESPONSE_YES) 
+		if (response ==  GTK_RESPONSE_YES) {
+			e_msg_composer_request_close (composer);
 			gtk_action_activate (gtkhtml_editor_get_action (editor, "save-draft"));
-		else if (response == GTK_RESPONSE_CANCEL)
+		} else if (response == GTK_RESPONSE_CANCEL)
 			return FALSE;
 			
 	}



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