phonebookui/Phonebook2/UIControls/src/CPbk2ContactEditorDlgImpl.cpp
branchRCL_3
changeset 12 4ae315f230bc
parent 11 2828b4d142c0
child 13 a6539d1e8e43
--- a/phonebookui/Phonebook2/UIControls/src/CPbk2ContactEditorDlgImpl.cpp	Tue May 11 16:00:21 2010 +0300
+++ b/phonebookui/Phonebook2/UIControls/src/CPbk2ContactEditorDlgImpl.cpp	Tue May 25 12:26:45 2010 +0300
@@ -221,18 +221,8 @@
         iEikonEnv->EikAppUi()->RemoveFromStack( iContextMenuBar );
         delete iContextMenuBar;
         }
-
-    // Restore the titlepane text
-    if (iTitlePane && iStoredTitlePaneText)
-        {
-        iTitlePane->SetTextL(*iStoredTitlePaneText);
-        }
-
-    // Reset title pane picture
-    if( iTitlePane )
-        {
-        iTitlePane->SetSmallPicture( NULL, NULL, EFalse );
-        }
+    
+    TRAP_IGNORE ( RestoreStatusPaneL() );    
 
     // Remove empty status pane
     if (iNaviContainer)
@@ -395,16 +385,6 @@
 //
 void CPbk2ContactEditorDlgImpl::ExecuteLD()
     {
-    CleanupStack::PushL( this );
-
-    // Set status pane layout to the Phonebook 2 one
-    CEikStatusPane* statusPane = iAvkonAppUi->StatusPane();
-    if (statusPane)
-        {
-        statusPane->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
-        }
-
-    CleanupStack::Pop( this );
     CAknForm::ExecuteLD(R_PBK2_EDIT_MEMORY_ENTRY_DIALOG);
     }
 
@@ -521,11 +501,11 @@
         CEikStatusPane* statusPane = iAvkonAppUi->StatusPane();
         if ( statusPane )
             {
-            TRAP_IGNORE(
-                    statusPane->SwitchLayoutL(
-                            R_AVKON_STATUS_PANE_LAYOUT_USUAL
-                            )
-            );
+            iCurrentstatuspane = statusPane->CurrentLayoutResId();
+            if( iCurrentstatuspane != R_AVKON_STATUS_PANE_LAYOUT_USUAL )
+                {
+                TRAP_IGNORE( statusPane->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL) );
+                }
             }
         }
     
@@ -801,6 +781,8 @@
     iEditorExtension->ModifyButtonGroupContainerL(ButtonGroupContainer());
 
     ConstructNaviPaneL();
+	UpdateTitleL();
+    UpdateTitlePictureL();
     }
 
 // --------------------------------------------------------------------------
@@ -809,8 +791,7 @@
 //
 void CPbk2ContactEditorDlgImpl::PostLayoutDynInitL()
     {
-    UpdateTitleL();
-    UpdateTitlePictureL();
+    
     if(iParams.iFocusedContactField)
         {
         const TInt count = iUiFieldArray->Count();
@@ -2576,6 +2557,17 @@
 				}
         	}
         }
+    CEikStatusPane* statusPane = iAvkonAppUi->StatusPane();
+    
+    if (statusPane)
+        {
+        iCurrentstatuspane = statusPane->CurrentLayoutResId();
+        if( iCurrentstatuspane != R_AVKON_STATUS_PANE_LAYOUT_USUAL )
+            {
+            statusPane->SwitchLayoutL(R_AVKON_STATUS_PANE_LAYOUT_USUAL);
+            }
+        }
+        
     }
 
 // --------------------------------------------------------------------------
@@ -3465,5 +3457,34 @@
         }
     }
 
+// --------------------------------------------------------------------------
+// CPbk2ContactEditorDlgImpl::RestoreStatusPaneL
+// --------------------------------------------------------------------------
+//
+void CPbk2ContactEditorDlgImpl::RestoreStatusPaneL() 
+    {    
+    //Restore StatusPane & Title    
+    if ( iCurrentstatuspane )
+        {
+        CEikStatusPane* statusPane = iAvkonAppUi->StatusPane();
+        
+        if (statusPane)
+            {
+            statusPane->SwitchLayoutL( iCurrentstatuspane );            
+            }            
+        }
+    // Restore the titlepane text
+    if (iTitlePane && iStoredTitlePaneText)
+        {    
+        iTitlePane->SetTextL(*iStoredTitlePaneText);
+        }
+    
+    // Reset title pane picture
+    if( iTitlePane )
+        {
+        iTitlePane->SetSmallPicture( NULL, NULL, EFalse );
+        }        
+    }
+   
 
 // End of File