commsconfig/cscsettingsui/src/cscsettingsuimainview.cpp
branchRCL_3
changeset 20 65a3ef1d5bd0
parent 14 be41ab7b952f
equal deleted inserted replaced
18:8c9c07ad8b6b 20:65a3ef1d5bd0
   137     }         
   137     }         
   138 
   138 
   139 
   139 
   140 // ---------------------------------------------------------------------------
   140 // ---------------------------------------------------------------------------
   141 // CCSCSettingsUiMainView::UpdateSoftkeysL
   141 // CCSCSettingsUiMainView::UpdateSoftkeysL
   142 // Processes situation when it´s notified that softkeys need to be changed.
   142 // Processes situation when it�s notified that softkeys need to be changed.
   143 // ---------------------------------------------------------------------------
   143 // ---------------------------------------------------------------------------
   144 //
   144 //
   145 void CCSCSettingsUiMainView::UpdateSoftkeysL( )
   145 void CCSCSettingsUiMainView::UpdateSoftkeysL( )
   146     {
   146     {
   147     // not used
   147     // not used
   259             break;
   259             break;
   260             }
   260             }
   261         case ECSCSettingsUiDelete:
   261         case ECSCSettingsUiDelete:
   262             {
   262             {
   263             CSCSETUIDEBUG( "    HandleCommandL - delete service" );
   263             CSCSETUIDEBUG( "    HandleCommandL - delete service" );
   264             iContainer->DeleteServiceL();
   264             iDeleted = iContainer->DeleteServiceL();
   265             iDeleted = ETrue;
   265             HandleReturnToPreviousViewL( EFalse );
   266             HandleReturnToPreviousViewL();
       
   267             break;
   266             break;
   268             }
   267             }
   269         case EEikCmdExit:
   268         case EEikCmdExit:
   270         case EAknSoftkeyExit:
   269         case EAknSoftkeyExit:
   271             {
   270             {
   871 // ---------------------------------------------------------------------------
   870 // ---------------------------------------------------------------------------
   872 // CCSCSettingsUiMainView::HandleReturnToPreviousViewL
   871 // CCSCSettingsUiMainView::HandleReturnToPreviousViewL
   873 // Handles returning to previous view where settingsui was launced.
   872 // Handles returning to previous view where settingsui was launced.
   874 // ---------------------------------------------------------------------------
   873 // ---------------------------------------------------------------------------
   875 //
   874 //
   876 void CCSCSettingsUiMainView::HandleReturnToPreviousViewL()
   875 void CCSCSettingsUiMainView::HandleReturnToPreviousViewL( TBool aViewBack )
   877     {
   876     {
   878     CSCSETUIDEBUG( 
   877     CSCSETUIDEBUG( 
   879         "CCSCSettingsUiMainView::HandleReturnToPreviousViewL - IN" );
   878         "CCSCSettingsUiMainView::HandleReturnToPreviousViewL - IN" );
   880 
   879 
   881     if ( iModel.ReturnViewId() != KNullUid )
   880     if ( iModel.ReturnViewId() != KNullUid )
   885         // Error code not needed.
   884         // Error code not needed.
   886         TRAP_IGNORE( 
   885         TRAP_IGNORE( 
   887             tabview.iUid = iModel.SettingsHandler().ServiceTabViewIdL( 
   886             tabview.iUid = iModel.SettingsHandler().ServiceTabViewIdL( 
   888             iModel.CurrentSPEntryId() ) )
   887             iModel.CurrentSPEntryId() ) )
   889 
   888 
       
   889         // Launched from phonebookview.
       
   890         // Press Back button, return PhoneBookTabView.
       
   891         if ( aViewBack && tabview.iUid == iModel.ReturnViewId().iUid )
       
   892             {
       
   893             RxSPViewServices viewServices;
       
   894             TInt err = viewServices.Activate( 
       
   895                 KPhoneBookTabUid.iUid, 
       
   896                 iModel.ReturnViewId().iUid );
       
   897 
       
   898             CSCSETUIDEBUG2( "   --> ACTIVATE ERR=%d", err );
       
   899 
       
   900             AppUi()->HandleCommandL( EEikCmdExit );
       
   901             }
       
   902         
   890         if ( iDeleted && KCSCServiceViewId != iModel.ReturnViewId() )
   903         if ( iDeleted && KCSCServiceViewId != iModel.ReturnViewId() )
   891             {
   904             {
       
   905             // Launched from phonebookview.
       
   906             // Press Ok button, return homescreen.
   892             TVwsViewId idleId;
   907             TVwsViewId idleId;
   893             AknDef::GetPhoneIdleViewId( idleId );
   908             AknDef::GetPhoneIdleViewId( idleId );
   894             ActivateViewL( idleId );
   909             ActivateViewL( idleId );
   895             AppUi()->HandleCommandL( EEikCmdExit );
   910             AppUi()->HandleCommandL( EEikCmdExit );
   896             }
   911             }
   897         else if ( tabview.iUid == iModel.ReturnViewId().iUid )
   912         else if( !iDeleted && KCSCServiceViewId != iModel.ReturnViewId() )
   898             {
   913             {
   899             RxSPViewServices viewServices;
   914             // Launched from phonebookview.
   900             TInt err = viewServices.Activate( 
   915             // Press cancel button, return current view.
   901                 KPhoneBookTabUid.iUid, 
   916             TUid curview = Id();
   902                 iModel.ReturnViewId().iUid );
   917             AppUi()->ActivateLocalViewL( curview );
   903 
   918             }
   904             CSCSETUIDEBUG2( "   --> ACTIVATE ERR=%d", err );
   919         else if( !aViewBack && !iDeleted && KCSCServiceViewId == iModel.ReturnViewId() )
   905 
   920             {
   906             AppUi()->HandleCommandL( EEikCmdExit );
   921             // Launched from service view.
       
   922             // Press cancel button, return current view.
       
   923             TUid curview = Id();
       
   924             AppUi()->ActivateLocalViewL( curview );
   907             }
   925             }
   908         else
   926         else
   909             {
   927             {
   910             // Not deleted or launched from service tab,
   928             // Launched from service view.
   911             // activate previous view.
   929             // Press Back button or Press Delete button, activate previous view.
   912             AppUi()->ActivateLocalViewL( iModel.ReturnViewId() );
   930             AppUi()->ActivateLocalViewL( iModel.ReturnViewId() );
   913             }
   931             }
   914         }
   932         }
   915       
   933       
   916     CSCSETUIDEBUG( 
   934     CSCSETUIDEBUG(