From 3fbcc8ef800b2c0ef74fcdea17f6a1e5ec01cdff Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Wed, 13 Oct 2010 15:37:12 -0400 Subject: EShellBackend: Respond to EShell::prepare-for-quit signals. Listen for "prepare-for-quit" signals from the shell and inhibit shutdown until all the activities we're tracking are finalized. Also, add a couple supporting functions: gboolean e_shell_backend_is_busy (EShellBackend *shell_backend); void e_shell_backend_cancel_all (EShellBackend *shell_backend); These will eventually replace mail_msg_active() and mail_cancel_all(). --- modules/mail/e-mail-shell-view-actions.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'modules/mail/e-mail-shell-view-actions.c') diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c index 852edbd147..3c4871bffe 100644 --- a/modules/mail/e-mail-shell-view-actions.c +++ b/modules/mail/e-mail-shell-view-actions.c @@ -830,7 +830,21 @@ static void action_mail_stop_cb (GtkAction *action, EMailShellView *mail_shell_view) { + EShellView *shell_view; + EShellBackend *shell_backend; + + shell_view = E_SHELL_VIEW (mail_shell_view); + shell_backend = e_shell_view_get_shell_backend (shell_view); + + /* XXX There's some overlap here: activities submitted through + * the legacy MailMsg system might be cancelled twice, but + * it shouldn't cause problems. */ + + /* the old way */ mail_cancel_all (); + + /* the new way */ + e_shell_backend_cancel_all (shell_backend); } static void -- cgit v1.2.3