emailuis/emailui/src/FreestyleEmailUiViewBase.cpp
branchRCL_3
changeset 73 c8382f7b54ef
parent 64 3533d4323edc
child 80 726fba06891a
--- a/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp	Tue Sep 14 20:48:24 2010 +0300
+++ b/emailuis/emailui/src/FreestyleEmailUiViewBase.cpp	Wed Sep 15 11:52:37 2010 +0300
@@ -153,6 +153,22 @@
         DeactivateControlGroup();
         NavigateBackL();
         }
+    
+    if( MailEditorId != Id() )// not for editor (when sending contact via mail)
+        {
+        //Reopen Contact details view if it was closed before
+        CFSEmailUiContactHandler* contactHandler = NULL; // not owned
+        CFsDelayedLoader* delLoader = CFsDelayedLoader::InstanceL(); // not owned
+        if( delLoader )
+            {
+            contactHandler = delLoader->GetContactHandlerL();
+            
+            if( contactHandler && contactHandler->WasDetailsClosed())
+                {
+                contactHandler->ReopenContactDetailsL(iEikonEnv->WsSession());
+                }
+            }
+       }
     }
 
 // ---------------------------------------------------------------------------
@@ -630,10 +646,23 @@
 
         if ( iPreviousAppUid != KFSEmailUiUid && iPreviousAppUid != KNullUid )
             {
+            //don't send to background when back from Contact Details (CCAApp)
+            CFSEmailUiContactHandler* contactHandler(NULL); // not owned
+            CFsDelayedLoader* delLoader = CFsDelayedLoader::InstanceL(); // not owned
+            if( delLoader )
+                {
+                contactHandler = delLoader->GetContactHandlerL();
+                }
+            // for Contact Details, after contact was sent via mail, app shouldn't be sent to background
+            if( contactHandler && iPreviousAppUid == contactHandler->GetDetailsAppUid() )
+                {
+                iSendToBackgroundOnDeactivation = EFalse;
+                iAppUi.SetSwitchingToBackground( EFalse );
+                }
             // Email app should be hidden once the view gets deactivated. Note that hiding
             // should not happen before control group switching is over because that
             // may cause views of other Alfred apps to get distorted.
-            if( !iAppUi.EmbeddedAppIsPreviousApp() ) // if previous app is embedded app,
+            else if( !iAppUi.EmbeddedAppIsPreviousApp() ) // if previous app is embedded app,
                 //do not need hide FSEmail app when previous app view gets deactivated.
                 {
                 iSendToBackgroundOnDeactivation = ETrue;