aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-composer-utils.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2008-04-09 10:00:45 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-04-09 10:00:45 +0800
commit534e5a1764bdbeb542cf3531c2575df451d8e572 (patch)
treecf340bb3975698b2cf1dfd61ac9bf6b10805bbc3 /mail/em-composer-utils.c
parentfea1867db330edef4260cd057e1f73b61aacc6fa (diff)
downloadgsoc2013-evolution-534e5a1764bdbeb542cf3531c2575df451d8e572.tar
gsoc2013-evolution-534e5a1764bdbeb542cf3531c2575df451d8e572.tar.gz
gsoc2013-evolution-534e5a1764bdbeb542cf3531c2575df451d8e572.tar.bz2
gsoc2013-evolution-534e5a1764bdbeb542cf3531c2575df451d8e572.tar.lz
gsoc2013-evolution-534e5a1764bdbeb542cf3531c2575df451d8e572.tar.xz
gsoc2013-evolution-534e5a1764bdbeb542cf3531c2575df451d8e572.tar.zst
gsoc2013-evolution-534e5a1764bdbeb542cf3531c2575df451d8e572.zip
** Fixes bug #523413
2008-04-08 Matthew Barnes <mbarnes@redhat.com> ** Fixes bug #523413 * composer/e-msg-composer.c (msg_composer_dispose): Use the 'application_exiting' private flag to determine whether to tell e_composer_autosave_unregister() to delete the autosave file. * composer/e-msg-composer.c (msg_composer_class_init), (e_msg_composer_save_draft): Remove the 'quit' parameter from the 'save-draft' signal. * composer/e-msg-composer.c (e_msg_composer_request_close_all): Take an autosave snapshot before activating the CLOSE action, and set the private 'application_exiting' flag. This should avoid prompting the user before shutting down. * composer/e-composer-actions.c (action_close_cb): When electing to save a message before closing, hide the window immediately. The callback function can then check the window's visibility after the save is complete to know whether to destroy the window. * composer/e-composer-autosave.c (e_composer_autosave_unregister): Add a 'delete_file' boolean parameter to determine whether to delete the autosave file. * composer/e-composer-private.h: Add an 'application_exiting' flag. * mail/em-composer-utils.c (save_draft_done): Check the composer window's visibility to determine whether to destroy the window. See the corresponding composer/ChangeLog entry to get the full story. * mail/em-composer-utils.c (em_utils_composer_save_draft_cb): Remove the 'quit' parameter. svn path=/trunk/; revision=35346
Diffstat (limited to 'mail/em-composer-utils.c')
-rw-r--r--mail/em-composer-utils.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 089b3bfea7..f5a3a2ced0 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -459,7 +459,6 @@ struct _save_draft_info {
struct emcs_t *emcs;
EMsgComposer *composer;
CamelMessageInfo *info;
- int quit;
};
static void
@@ -511,7 +510,10 @@ save_draft_done (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *i
emcs->drafts_uid = g_strdup (appended_uid);
}
- if (sdi->quit)
+ /* 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))
gtk_widget_destroy (GTK_WIDGET (sdi->composer));
done:
@@ -534,7 +536,7 @@ save_draft_folder (char *uri, CamelFolder *folder, gpointer data)
}
void
-em_utils_composer_save_draft_cb (EMsgComposer *composer, int quit, gpointer user_data)
+em_utils_composer_save_draft_cb (EMsgComposer *composer, gpointer user_data)
{
const char *default_drafts_folder_uri = mail_component_get_folder_uri(NULL, MAIL_COMPONENT_FOLDER_DRAFTS);
CamelFolder *drafts_folder = mail_component_get_folder(NULL, MAIL_COMPONENT_FOLDER_DRAFTS);
@@ -559,7 +561,6 @@ em_utils_composer_save_draft_cb (EMsgComposer *composer, int quit, gpointer user
sdi->emcs = user_data;
if (sdi->emcs)
emcs_ref(sdi->emcs);
- sdi->quit = quit;
if (account && account->drafts_folder_uri &&
strcmp (account->drafts_folder_uri, default_drafts_folder_uri) != 0) {