diff -r e1b6206813b4 -r f5907b1a1053 emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp --- a/emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp Fri Feb 19 22:37:30 2010 +0200 +++ b/emailuis/emailui/src/FreestyleEmailUiLauncherGridVisualiser.cpp Fri Mar 12 15:41:14 2010 +0200 @@ -144,6 +144,10 @@ iUiOperationLaunched = EFalse; iMailboxDeleter = CFSEmailUiMailboxDeleter::NewL( *iAppUi.GetMailClient(), *this ); + + // Create startup timer + iStartupCallbackTimer = CFSEmailUiGenericTimer::NewL( this ); + } // ---------------------------------------------------------------------------- @@ -294,6 +298,13 @@ CFSEmailUiLauncherGridVisualiser::~CFSEmailUiLauncherGridVisualiser() { FUNC_LOG; + + if ( iStartupCallbackTimer ) + { + iStartupCallbackTimer->Cancel(); + delete iStartupCallbackTimer; + } + iPluginIdIconIdPairs.Reset(); iIconArray.Close(); iMailboxRequestIds.Close(); @@ -2677,5 +2688,28 @@ iStylusPopUpMenuLaunched = ETrue; } +void CFSEmailUiLauncherGridVisualiser::HandleAppForegroundEventL( TBool aForeground ) + { + CFsEmailUiViewBase::HandleAppForegroundEventL( aForeground ); + // If the view is not visible try to visualise it after a while + if ( aForeground && ( !iWasActiveControlGroup ) ) + { + // + iStartupCallbackTimer->Cancel(); // just in case + iStartupCallbackTimer->SetPriority( CActive::EPriorityIdle ); + // EPriorityIdle, EPriorityLow, EPriorityStandard + iStartupCallbackTimer->Start( 200 ); + } + } -// End of file. +// Fire timer callback +void CFSEmailUiLauncherGridVisualiser::TimerEventL( CFSEmailUiGenericTimer* /* aTriggeredTimer */ ) +{ + // if view is still active then + if ( ( NULL != iAppUi.CurrentActiveView() ) && ( iAppUi.CurrentActiveView()->Id() == Id() ) ) + { + iWasActiveControlGroup = ETrue; + HandleAppForegroundEventL( ETrue ); + } +}; +