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 /*** NSSM support is discontinued. |
121 |
122 Code is kept in comments temporarily because similar UI functionality |
|
123 might be needed for another purpose. |
|
124 TBool ffs(EFalse); |
122 TBool ffs(EFalse); |
125 switch ( aCommand ) |
123 switch ( aCommand ) |
126 { |
124 { |
127 case EAknSoftkeyBack: |
125 case EAknSoftkeyBack: |
128 { |
126 { |
129 //GET CURRENT ADDRESS |
127 //GET CURRENT ADDRESS |
130 ASSERT( iContainer ); |
128 ASSERT( iContainer ); |
131 |
129 |
132 const TAcuApiServerDetails& serverDetails = iContainer->ServerDetailsL(); |
130 const TAgileProvisionApiServerSettings& serverDetails = iContainer->ServerDetailsL(); |
133 |
131 |
134 ffs = iLoader.FFSSpaceBelowCriticalLevelL( ETrue, 0 ); |
132 ffs = iLoader.FFSSpaceBelowCriticalLevelL( ETrue, 0 ); |
135 if (ffs) |
133 if (ffs) |
136 { |
134 { |
137 iLoader.iBackFromServerDefinition = ETrue; |
135 iLoader.iBackFromServerDefinition = ETrue; |
147 iLoader.ChangeViewL( KChangeViewPrevious ); |
145 iLoader.ChangeViewL( KChangeViewPrevious ); |
148 } |
146 } |
149 } |
147 } |
150 else |
148 else |
151 { |
149 { |
152 TBool createServer = ETrue; |
150 |
153 if(createServer) |
151 int aResult = iLoader.VpnApiWrapperL().CreateServer(serverDetails); |
154 { |
|
155 //Creating a new VPN policy server |
|
156 if( iContainer->ServerIndex() == -1) |
|
157 { |
|
158 int aResult = iLoader.AcuApiWrapperL().CreateServer(serverDetails); |
|
159 if (aResult == KErrNone) |
152 if (aResult == KErrNone) |
160 { |
153 { |
161 //Update iServerList of CAcuApiWrapper |
154 |
162 //After that we can call Synchronise server from |
|
163 //CVpnManagementUiPolicyContainer::ActivateL() |
|
164 |
|
165 iLoader.AcuApiWrapperL().ServerListL(); |
|
166 |
155 |
167 iLoader.iNewServerDefinition = ETrue; |
156 iLoader.iNewServerDefinition = ETrue; |
168 } |
157 } |
169 else |
158 else |
170 { |
159 { |
171 iLoader.iShowDefineQuery = EFalse; |
160 iLoader.iShowDefineQuery = EFalse; |
172 iLoader.iBackFromServerDefinition = ETrue; |
161 iLoader.iBackFromServerDefinition = ETrue; |
173 iLoader.iNewServerDefinition = EFalse; |
162 iLoader.iNewServerDefinition = EFalse; |
174 createServer = EFalse; |
|
175 |
163 |
176 CErrorUI* errorUi = CErrorUI::NewLC( *(CCoeEnv::Static()) ); |
164 CErrorUI* errorUi = CErrorUI::NewLC( *(CCoeEnv::Static()) ); |
177 errorUi->ShowGlobalErrorNoteL( aResult ); |
165 errorUi->ShowGlobalErrorNoteL( aResult ); |
178 CleanupStack::PopAndDestroy(); // errorUi |
166 CleanupStack::PopAndDestroy(); // errorUi |
179 } |
167 } |
180 } |
168 |
181 //Editing an existing policy server |
|
182 else |
|
183 { |
|
184 iLoader.AcuApiWrapperL().SaveServerDetails(serverDetails); |
|
185 } |
|
186 } |
169 } |
187 |
170 |
188 iLoader.ChangeViewL( KChangeViewPrevious ); |
171 iLoader.ChangeViewL( KChangeViewPrevious ); |
189 } |
172 break; |
190 break; |
|
191 } |
173 } |
192 case EAknCmdExit: |
174 case EAknCmdExit: |
193 { |
175 { |
194 ((CAknViewAppUi*)iAvkonAppUi)->HandleCommandL( EAknCmdExit ); |
176 ((CAknViewAppUi*)iAvkonAppUi)->HandleCommandL( EAknCmdExit ); |
195 break; |
177 break; |