vpnui/vpnmanagementui/src/vpnmanagementuiserversettingsview.cpp
branchRCL_3
changeset 49 5960d2d03390
parent 41 e06095241a65
equal deleted inserted replaced
46:29c8f9bc68e1 49:5960d2d03390
   114 // ---------------------------------------------------------
   114 // ---------------------------------------------------------
   115 // CServerSettingsView::HandleCommandL(TInt aCommand)
   115 // CServerSettingsView::HandleCommandL(TInt aCommand)
   116 // Handles Softkey and Options list commands
   116 // Handles Softkey and Options list commands
   117 // ---------------------------------------------------------
   117 // ---------------------------------------------------------
   118 //
   118 //
   119 void CServerSettingsView::HandleCommandL( TInt aCommand)
   119 void CServerSettingsView::HandleCommandL( TInt /* aCommand */)
   120     {
   120     {
   121    
   121     /*** NSSM support is discontinued.
       
   122          Code is kept in comments temporarily because similar UI functionality
       
   123          might be needed for another purpose.
   122     TBool ffs(EFalse);
   124     TBool ffs(EFalse);
   123     switch ( aCommand )
   125     switch ( aCommand )
   124         {
   126         {
   125         case EAknSoftkeyBack:
   127         case EAknSoftkeyBack:
   126             {            
   128             {            
   127             //GET CURRENT ADDRESS
   129             //GET CURRENT ADDRESS
   128             ASSERT( iContainer );
   130             ASSERT( iContainer );
   129             
   131             
   130             const TAgileProvisionApiServerSettings& serverDetails = iContainer->ServerDetailsL();
   132             const TAcuApiServerDetails& serverDetails = iContainer->ServerDetailsL();
   131 
   133 
   132             ffs = iLoader.FFSSpaceBelowCriticalLevelL( ETrue, 0 );
   134             ffs = iLoader.FFSSpaceBelowCriticalLevelL( ETrue, 0 );
   133             if (ffs)
   135             if (ffs)
   134     	        {
   136     	        {
   135                 iLoader.iBackFromServerDefinition = ETrue;
   137                 iLoader.iBackFromServerDefinition = ETrue;
   145        			    iLoader.ChangeViewL( KChangeViewPrevious );
   147        			    iLoader.ChangeViewL( KChangeViewPrevious );
   146                     }
   148                     }
   147                 }
   149                 }
   148             else
   150             else
   149                 {
   151                 {
   150               
   152                 TBool createServer = ETrue;
   151 	                        int aResult = iLoader.VpnApiWrapperL().CreateServer(serverDetails);
   153                 if(createServer)
       
   154                     {
       
   155                     //Creating a new VPN policy server
       
   156                     if( iContainer->ServerIndex() == -1)
       
   157                         {
       
   158 	                        int aResult = iLoader.AcuApiWrapperL().CreateServer(serverDetails);
   152 	                        if (aResult == KErrNone)
   159 	                        if (aResult == KErrNone)
   153 		                        {
   160 		                        {
   154 		                    
   161 		                        //Update iServerList of CAcuApiWrapper 
       
   162 		                        //After that we can call Synchronise server from 
       
   163 		                        //CVpnManagementUiPolicyContainer::ActivateL()
       
   164 		                        
       
   165 		                        iLoader.AcuApiWrapperL().ServerListL();
   155 		                        
   166 		                        
   156 		                        iLoader.iNewServerDefinition = ETrue;
   167 		                        iLoader.iNewServerDefinition = ETrue;
   157 		                        }
   168 		                        }
   158 		                    else
   169 		                    else
   159 		                    	{
   170 		                    	{
   160 			                    iLoader.iShowDefineQuery = EFalse;
   171 			                    iLoader.iShowDefineQuery = EFalse;
   161 			                    iLoader.iBackFromServerDefinition = ETrue;
   172 			                    iLoader.iBackFromServerDefinition = ETrue;
   162 	                    		iLoader.iNewServerDefinition = EFalse;
   173 	                    		iLoader.iNewServerDefinition = EFalse;
       
   174 	    	    				createServer = EFalse;
   163 
   175 
   164 						    	CErrorUI* errorUi = CErrorUI::NewLC( *(CCoeEnv::Static()) );
   176 						    	CErrorUI* errorUi = CErrorUI::NewLC( *(CCoeEnv::Static()) );
   165 						        errorUi->ShowGlobalErrorNoteL( aResult );
   177 						        errorUi->ShowGlobalErrorNoteL( aResult );
   166 						        CleanupStack::PopAndDestroy();  // errorUi
   178 						        CleanupStack::PopAndDestroy();  // errorUi
   167 		                    	}
   179 		                    	}
   168            
   180                         }
       
   181                     //Editing an existing policy server
       
   182                     else
       
   183                         {
       
   184                         iLoader.AcuApiWrapperL().SaveServerDetails(serverDetails);
       
   185                         }  
   169                     }
   186                     }
   170 
   187 
   171 			    iLoader.ChangeViewL( KChangeViewPrevious );
   188 			    iLoader.ChangeViewL( KChangeViewPrevious );
   172                 break;
   189                 }
       
   190             break;
   173             }
   191             }
   174 		case EAknCmdExit:
   192 		case EAknCmdExit:
   175 			{
   193 			{
   176 			((CAknViewAppUi*)iAvkonAppUi)->HandleCommandL( EAknCmdExit );
   194 			((CAknViewAppUi*)iAvkonAppUi)->HandleCommandL( EAknCmdExit );
   177 			break;
   195 			break;
   194         default:
   212         default:
   195             {
   213             {
   196             AppUi()->HandleCommandL( aCommand );
   214             AppUi()->HandleCommandL( aCommand );
   197             break;
   215             break;
   198             }
   216             }
   199         }
   217         } ***/
   200     }
   218     }
   201 
   219 
   202 // ---------------------------------------------------------
   220 // ---------------------------------------------------------
   203 // CServerSettingsView::HandleClientRectChange()
   221 // CServerSettingsView::HandleClientRectChange()
   204 // ---------------------------------------------------------
   222 // ---------------------------------------------------------