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 |
499 TInt selectedIndex = iModel->DefaultProfileIndex(); |
500 TInt aFlage = iContainer->DrawerFlags(); |
500 TInt oldProfileIndex = selectedIndex; |
501 if( aFlage & CTextListItemDrawer::EDisableMarquee ) |
501 |
502 { |
502 // Get the array of the profile names, ownership changes |
503 TInt selectedIndex = iContainer->CurrentIndex(); |
503 CDesCArray* array = iModel->ListOfProfileNamesL(); |
504 iModel->SetDefaultProfileL( selectedIndex ); |
504 CleanupStack::PushL( array ); |
505 } |
505 |
506 else |
506 // Create and display the pop-up list |
507 { |
507 CAknRadioButtonSettingPage* defaultPopUp = |
508 TInt selectedIndex = iModel->DefaultProfileIndex(); |
508 new ( ELeave ) CAknRadioButtonSettingPage( |
509 TInt oldProfileIndex = selectedIndex; |
509 R_SIP_PROFILE_LIST_VIEW_DEFAULT_SETTING_PAGE, |
510 |
510 selectedIndex, |
511 // Get the array of the profile names, ownership changes |
511 array ); |
512 CDesCArray* array = iModel->ListOfProfileNamesL(); |
512 if ( defaultPopUp->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) ) |
513 CleanupStack::PushL( array ); |
513 { |
514 |
514 if ( selectedIndex != oldProfileIndex ) |
515 // Create and display the pop-up list |
515 { |
516 CAknRadioButtonSettingPage* defaultPopUp = |
516 // User has changed the default profile, set new setting |
517 new ( ELeave ) CAknRadioButtonSettingPage( |
517 // to persistent storage |
518 R_SIP_PROFILE_LIST_VIEW_DEFAULT_SETTING_PAGE, |
518 iModel->SetDefaultProfileL( selectedIndex ); |
519 selectedIndex, |
519 } |
520 array ); |
520 } |
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 } |
|
530 |
521 |
531 CleanupStack::PopAndDestroy( array ); // array |
522 CleanupStack::PopAndDestroy( array ); // array |
532 } |
|
533 __GSLOGSTRING("CSIPSettingsPlugin::ChangeDefaultProfileL End" ) |
523 __GSLOGSTRING("CSIPSettingsPlugin::ChangeDefaultProfileL End" ) |
534 } |
524 } |
535 |
525 |
536 // ----------------------------------------------------------------------------- |
526 // ----------------------------------------------------------------------------- |
537 // CSIPSettingsPlugin::CreateFromExistingProfileL |
527 // CSIPSettingsPlugin::CreateFromExistingProfileL |