sipplugins/sippsipsettingsui/src/sipsettingsplugin.cpp
branchRCL_3
changeset 20 0dcb073356a5
parent 19 b5e99d8877c7
child 21 346e49b9ce14
equal deleted inserted replaced
19:b5e99d8877c7 20:0dcb073356a5
   494 // -----------------------------------------------------------------------------
   494 // -----------------------------------------------------------------------------
   495 //
   495 //
   496 void CSIPSettingsPlugin::ChangeDefaultProfileL()
   496 void CSIPSettingsPlugin::ChangeDefaultProfileL()
   497     {
   497     {
   498     __GSLOGSTRING("CSIPSettingsPlugin::ChangeDefaultProfileL Start " )
   498     __GSLOGSTRING("CSIPSettingsPlugin::ChangeDefaultProfileL Start " )
   499     TInt selectedIndex = iModel->DefaultProfileIndex();  
   499     		
   500     TInt oldProfileIndex = selectedIndex;  
   500     TInt aFlage = iContainer->DrawerFlags();	
   501     
   501     if( aFlage & CTextListItemDrawer::EDisableMarquee )
   502     // Get the array of the profile names, ownership changes
   502     	{
   503     CDesCArray* array = iModel->ListOfProfileNamesL();    
   503 		TInt selectedIndex = iContainer->CurrentIndex();
   504     CleanupStack::PushL( array );
   504 		iModel->SetDefaultProfileL( selectedIndex );
   505     
   505     	}
   506     // Create and display the pop-up list
   506     else 
   507     CAknRadioButtonSettingPage* defaultPopUp = 
   507     	{		
   508         new ( ELeave ) CAknRadioButtonSettingPage( 
   508 		TInt selectedIndex = iModel->DefaultProfileIndex();  
   509             R_SIP_PROFILE_LIST_VIEW_DEFAULT_SETTING_PAGE,
   509 		TInt oldProfileIndex = selectedIndex;  
   510             selectedIndex,
   510 		
   511             array );
   511 		// Get the array of the profile names, ownership changes
   512     if ( defaultPopUp->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
   512 		CDesCArray* array = iModel->ListOfProfileNamesL();    
   513         {
   513 		CleanupStack::PushL( array );
   514         if ( selectedIndex != oldProfileIndex )
   514 		
   515             {
   515 		// Create and display the pop-up list
   516             // User has changed the default profile, set new setting
   516 		CAknRadioButtonSettingPage* defaultPopUp = 
   517             // to persistent storage
   517 			new ( ELeave ) CAknRadioButtonSettingPage( 
   518             iModel->SetDefaultProfileL( selectedIndex );
   518 				R_SIP_PROFILE_LIST_VIEW_DEFAULT_SETTING_PAGE,
   519             }
   519 				selectedIndex,
   520         }
   520 				array );
       
   521 		if ( defaultPopUp->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
       
   522 			{
       
   523 			if ( selectedIndex != oldProfileIndex )
       
   524 				{
       
   525 				// User has changed the default profile, set new setting
       
   526 				// to persistent storage
       
   527 				iModel->SetDefaultProfileL( selectedIndex );
       
   528 				}
       
   529 			}
   521 
   530 
   522     CleanupStack::PopAndDestroy( array );  // array
   531     CleanupStack::PopAndDestroy( array );  // array
       
   532     	}
   523     __GSLOGSTRING("CSIPSettingsPlugin::ChangeDefaultProfileL End" )
   533     __GSLOGSTRING("CSIPSettingsPlugin::ChangeDefaultProfileL End" )
   524     }
   534     }
   525 
   535 
   526 // -----------------------------------------------------------------------------
   536 // -----------------------------------------------------------------------------
   527 // CSIPSettingsPlugin::CreateFromExistingProfileL
   537 // CSIPSettingsPlugin::CreateFromExistingProfileL