From abb9648eb5ab7a4cceadbf5054a794a84c9fe3cb Mon Sep 17 00:00:00 2001 From: Not Zed Date: Thu, 22 Apr 2004 06:09:19 +0000 Subject: force check of autosaved messages as soon as the mailer starts up (well, 2004-04-22 Not Zed * mail-component.c (view_control_activate_cb): force check of autosaved messages as soon as the mailer starts up (well, after a delay, this seems wrong). #57093. svn path=/trunk/; revision=25576 --- mail/mail-component.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'mail/mail-component.c') diff --git a/mail/mail-component.c b/mail/mail-component.c index 0d83da9112..05ca8cfb5a 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -365,11 +365,20 @@ get_prop(BonoboPropertyBag *bag, BonoboArg *arg, guint arg_id, CORBA_Environment } } +static int +check_autosave(void *data) +{ + e_msg_composer_check_autosave(NULL); + + return FALSE; +} + static void view_control_activate_cb (BonoboControl *control, gboolean activate, EMFolderView *view) { BonoboUIComponent *uic; - + static int recover = 0; + uic = bonobo_control_get_ui_component (control); g_assert (uic != NULL); @@ -389,6 +398,14 @@ view_control_activate_cb (BonoboControl *control, gboolean activate, EMFolderVie em_folder_view_activate (view, uic, activate); bonobo_ui_component_unset_container (uic, NULL); } + + /* This is a weird place to put it, but createControls does it too early. + I also think we should wait to do it until we actually visit the mailer. + The delay is arbitrary - without it it shows up before the main window */ + if (!recover) { + recover = 1; + g_timeout_add(1000, check_autosave, NULL); + } } /* GObject methods. */ -- cgit v1.2.3