sipplugins/sippsipsettingsui/src/gssipmodel.cpp
branchRCL_3
changeset 14 532ef74cdfa0
parent 9 1e1cc61f56c3
child 16 43c4dec3cb1f
equal deleted inserted replaced
12:c2e8c8b73582 14:532ef74cdfa0
    45 //
    45 //
    46 CGSSIPModel::CGSSIPModel() 
    46 CGSSIPModel::CGSSIPModel() 
    47     {
    47     {
    48     __GSLOGSTRING("CGSSIPModel::CGSSIPModel" )
    48     __GSLOGSTRING("CGSSIPModel::CGSSIPModel" )
    49     iQuitAfterSave = EFalse;
    49     iQuitAfterSave = EFalse;
       
    50     iIsRegistering = EFalse;
    50     }
    51     }
    51 
    52 
    52 // -----------------------------------------------------------------------------
    53 // -----------------------------------------------------------------------------
    53 // CGSSIPModel::ConstructL
    54 // CGSSIPModel::ConstructL
    54 // Symbian 2nd phase constructor can leave.
    55 // Symbian 2nd phase constructor can leave.
   121     TBool moveToNextView = ETrue;
   122     TBool moveToNextView = ETrue;
   122 
   123 
   123     CSIPManagedProfile* profile = 
   124     CSIPManagedProfile* profile = 
   124         static_cast<CSIPManagedProfile*>( iProfiles->At( aIndex ) );
   125         static_cast<CSIPManagedProfile*>( iProfiles->At( aIndex ) );
   125 
   126 
   126     if ( iEngine->IsInUseL( *profile ) )
   127     if ( iEngine->IsInUseL( *profile ) || iIsRegistering )
   127         {
   128         {
   128         HBufC* errorTxt = StringLoader::LoadLC( R_QTN_SIP_ERROR_PROFILE_USED );
   129         HBufC* errorTxt = StringLoader::LoadLC( R_QTN_SIP_ERROR_PROFILE_USED );
   129         CAknErrorNote* note = new ( ELeave ) CAknErrorNote( ETrue );
   130         CAknErrorNote* note = new ( ELeave ) CAknErrorNote( ETrue );
   130         note->ExecuteLD( errorTxt->Des() );
   131         note->ExecuteLD( errorTxt->Des() );
   131         CleanupStack::PopAndDestroy( errorTxt );        
   132         CleanupStack::PopAndDestroy( errorTxt );        
   430 //
   431 //
   431 TBool CGSSIPModel::ErrorInRegistration( TInt aIndex )
   432 TBool CGSSIPModel::ErrorInRegistration( TInt aIndex )
   432     {    
   433     {    
   433     __GSLOGSTRING("CGSSIPModel::ErrorInRegistration" )
   434     __GSLOGSTRING("CGSSIPModel::ErrorInRegistration" )
   434     __GSLOGSTRING1("CGSSIPModel::ErrorInRegistration aIndex: %d", aIndex)
   435     __GSLOGSTRING1("CGSSIPModel::ErrorInRegistration aIndex: %d", aIndex)
       
   436     
       
   437     if(iEngine->LastRegistrationError( 
       
   438             *( iProfiles->At( aIndex ) ) ) != KErrNone)
       
   439     	{
       
   440             iIsRegistering = EFalse;
       
   441     	}
   435     return ( iEngine->LastRegistrationError( 
   442     return ( iEngine->LastRegistrationError( 
   436         *( iProfiles->At( aIndex ) ) ) != KErrNone );
   443         *( iProfiles->At( aIndex ) ) ) != KErrNone );
   437     }
   444     }
   438 
   445 
   439 // -----------------------------------------------------------------------------
   446 // -----------------------------------------------------------------------------
   455         case EProfileUpdated:	
   462         case EProfileUpdated:	
   456             TRAP_IGNORE( ProfileUpdatedL( aSIPProfileId ) )
   463             TRAP_IGNORE( ProfileUpdatedL( aSIPProfileId ) )
   457             break;
   464             break;
   458         case EProfileRegistered:						
   465         case EProfileRegistered:						
   459         case EProfileDeregistered:
   466         case EProfileDeregistered:
       
   467         	{
       
   468             iIsRegistering = EFalse;
   460             ProfileRegistrationStatusChanged( aSIPProfileId );
   469             ProfileRegistrationStatusChanged( aSIPProfileId );
   461             break;
   470             break;
       
   471         	}
   462         case EProfileDestroyed:
   472         case EProfileDestroyed:
   463             ProfileDestroyed( aSIPProfileId );
   473             ProfileDestroyed( aSIPProfileId );
   464             break;
   474             break;
   465         default:
   475         default:
   466             // Do nothing.
   476             // Do nothing.
   748         TInt j( 0 );
   758         TInt j( 0 );
   749         while ( profilePointerArray.Count() > 0 )
   759         while ( profilePointerArray.Count() > 0 )
   750             {
   760             {
   751             CSIPManagedProfile* profile = 
   761             CSIPManagedProfile* profile = 
   752                 static_cast<CSIPManagedProfile*>( profilePointerArray[j] );
   762                 static_cast<CSIPManagedProfile*>( profilePointerArray[j] );
       
   763              iIsRegistering = EFalse;
       
   764             
   753             iProfiles->AppendL( profile );
   765             iProfiles->AppendL( profile );
   754             profilePointerArray.Remove( j );
   766             profilePointerArray.Remove( j );
   755             }                    
   767             }                    
   756         profilePointerArray.Reset();    
   768         profilePointerArray.Reset();    
   757         }
   769         }
   940         {
   952         {
   941         profile = Profile( iProfileData.iID );
   953         profile = Profile( iProfileData.iID );
   942         }
   954         }
   943     
   955     
   944     GSSIPProfileUtil::CopyProfileAttributesL( profile, iProfileData );
   956     GSSIPProfileUtil::CopyProfileAttributesL( profile, iProfileData );
       
   957     if(iProfileData.iRegistrationMode == EGSAlwaysOn)
       
   958     	{
       
   959         iIsRegistering = ETrue;
       
   960     	}
   945     GSSIPProfileUtil::CopyServerAttributesL( 
   961     GSSIPProfileUtil::CopyServerAttributesL( 
   946         profile, KSIPOutboundProxy, iProfileData.iProxy );
   962         profile, KSIPOutboundProxy, iProfileData.iProxy );
   947     GSSIPProfileUtil::CopyServerAttributesL( 
   963     GSSIPProfileUtil::CopyServerAttributesL( 
   948         profile, KSIPRegistrar, iProfileData.iRegistrar );
   964         profile, KSIPRegistrar, iProfileData.iRegistrar );
   949     
   965