cmmanager/cmmgr/Framework/Src/cmdlg.cpp
branchRCL_3
changeset 36 04408506c6e0
parent 26 0a9e01492035
child 55 fc7b30ed2058
equal deleted inserted replaced
26:0a9e01492035 36:04408506c6e0
  1058     CCmPluginBase* cm = CurrentCML();
  1058     CCmPluginBase* cm = CurrentCML();
  1059     if ( !cm )
  1059     if ( !cm )
  1060         {
  1060         {
  1061         return;
  1061         return;
  1062         }
  1062         }
  1063 
  1063     
  1064     if ( cm->GetBoolAttributeL( ECmProtected ) ||
  1064     if ( cm->GetBoolAttributeL( ECmProtected ) ||
  1065         ( iCmDestinationImpl && 
  1065         ( iCmDestinationImpl && 
  1066          iCmDestinationImpl->ProtectionLevel() == CMManager::EProtLevel1 ) )
  1066          iCmDestinationImpl->ProtectionLevel() == CMManager::EProtLevel1 ) )
  1067         {
  1067         {
  1068         TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED,
  1068         TCmCommonUi::ShowNoteL( R_CMWIZARD_CANNOT_PERFORM_FOR_PROTECTED,
  1109         TCmCommonUi::ShowNoteL( R_CMWIZARD_NO_VPN_STACKING,
  1109         TCmCommonUi::ShowNoteL( R_CMWIZARD_NO_VPN_STACKING,
  1110                                 TCmCommonUi::ECmErrorNote );        
  1110                                 TCmCommonUi::ECmErrorNote );        
  1111         CleanupStack::PopAndDestroy( &destArray );
  1111         CleanupStack::PopAndDestroy( &destArray );
  1112         return;
  1112         return;
  1113         }
  1113         }
  1114     
  1114 
       
  1115     // create a copy of the current connection method
       
  1116     CCmPluginBase* cmCopy = cm->CreateCopyL();
       
  1117     CleanupStack::PushL( cmCopy );
       
  1118 
  1115     // ok, there is at least 1, pop up the dialog
  1119     // ok, there is at least 1, pop up the dialog
  1116     CSelectDestinationDlg* dlg = CSelectDestinationDlg::NewL( destId, 
  1120     CSelectDestinationDlg* dlg = CSelectDestinationDlg::NewL( destId, 
  1117                                                               *iCmManager, 
  1121                                                               *iCmManager, 
  1118                                                               &destArray );
  1122                                                               &destArray );
  1119 
  1123 
  1121         {
  1125         {
  1122         CCmDestinationImpl* dest = iCmManager->DestinationL( destId );
  1126         CCmDestinationImpl* dest = iCmManager->DestinationL( destId );
  1123         CleanupStack::PushL( dest ); 
  1127         CleanupStack::PushL( dest ); 
  1124         if ( iCmDestinationImpl )
  1128         if ( iCmDestinationImpl )
  1125             {
  1129             {
  1126             // create a copy of the current connection method
       
  1127             CCmPluginBase* cmCopy = cm->CreateCopyL();
       
  1128             CleanupStack::PushL( cmCopy );
       
  1129             // store it in commsdat
  1130             // store it in commsdat
  1130             cmCopy->UpdateL();
  1131             cmCopy->UpdateL();
  1131             dest->AddConnectionMethodL( *cmCopy );
  1132             dest->AddConnectionMethodL( *cmCopy );
  1132             
       
  1133             CleanupStack::PopAndDestroy( cmCopy );
       
  1134             }
  1133             }
  1135         else
  1134         else
  1136             {
  1135             {
  1137             iCmManager->CopyConnectionMethodL( *dest, *( cm ) );
  1136             iCmManager->CopyConnectionMethodL( *dest, *( cm ) );
  1138             }
  1137             }
  1145             }
  1144             }
  1146     
  1145     
  1147         CleanupStack::PopAndDestroy( dest );
  1146         CleanupStack::PopAndDestroy( dest );
  1148         HandleListboxDataChangeL();                             
  1147         HandleListboxDataChangeL();                             
  1149         }
  1148         }
  1150 
  1149     CleanupStack::PopAndDestroy( cmCopy );
  1151     CleanupStack::PopAndDestroy( &destArray );
  1150     CleanupStack::PopAndDestroy( &destArray );
  1152     }
  1151     }
  1153 
  1152 
  1154 // --------------------------------------------------------------------------
  1153 // --------------------------------------------------------------------------
  1155 // CCmDlg::MoveConnectionMethodL
  1154 // CCmDlg::MoveConnectionMethodL