diff options
-rw-r--r-- | composer/e-composer-actions.c | 2 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 17 | ||||
-rw-r--r-- | composer/e-msg-composer.h | 4 | ||||
-rw-r--r-- | mail/em-composer-utils.c | 5 |
4 files changed, 24 insertions, 4 deletions
diff --git a/composer/e-composer-actions.c b/composer/e-composer-actions.c index 62372a7f1d..851b0f3e53 100644 --- a/composer/e-composer-actions.c +++ b/composer/e-composer-actions.c @@ -1,3 +1,4 @@ +/* -*- 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 @@ -85,6 +86,7 @@ action_close_cb (GtkAction *action, switch (response) { case GTK_RESPONSE_YES: gtk_widget_hide (widget); + e_msg_composer_request_close (composer); gtk_action_activate (ACTION (SAVE_DRAFT)); break; diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 9a28a68f3a..c10ef997d4 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -1,3 +1,4 @@ +/* -*- 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 @@ -3955,6 +3956,22 @@ e_msg_composer_set_enable_autosave (EMsgComposer *composer, e_composer_autosave_set_enabled (composer, enabled); } +gboolean +e_msg_composer_is_exiting (EMsgComposer *composer) +{ + g_return_val_if_fail (composer != NULL, FALSE); + + return composer->priv->application_exiting; +} + +void +e_msg_composer_request_close (EMsgComposer *composer) +{ + g_return_val_if_fail (composer != NULL, FALSE); + + composer->priv->application_exiting = TRUE; +} + EMsgComposer * e_msg_composer_load_from_file (const gchar *filename) { diff --git a/composer/e-msg-composer.h b/composer/e-msg-composer.h index e0d118b4f4..116eb38425 100644 --- a/composer/e-msg-composer.h +++ b/composer/e-msg-composer.h @@ -1,3 +1,4 @@ +/* -*- 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 @@ -135,6 +136,7 @@ void e_msg_composer_add_message_attachments CamelMimeMessage *message, gboolean just_inlines); +void e_msg_composer_request_close (EMsgComposer *composer); EMsgComposer * e_msg_composer_load_from_file (const gchar *filename); void e_msg_composer_check_autosave (GtkWindow *parent); @@ -148,6 +150,8 @@ EAttachmentView * GByteArray * e_msg_composer_get_raw_message_text (EMsgComposer *composer); +gboolean e_msg_composer_is_exiting (EMsgComposer *composer); + GList * e_load_spell_languages (void); void e_save_spell_languages (GList *spell_languages); diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index b4fcebf803..a555da6bbd 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -555,10 +555,7 @@ save_draft_done (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *i emcs->drafts_uid = g_strdup (appended_uid); } - /* This is kind of a hack, but the composer's CLOSE action - * hides the window before emitting the "save-draft" signal. - * We use that to determine whether to destroy the composer. */ - if (!GTK_WIDGET_VISIBLE (sdi->composer)) + if (e_msg_composer_is_exiting (sdi->composer)) gtk_widget_destroy (GTK_WIDGET (sdi->composer)); done: |