267 void CLocSUPLServerEditor::ProcessCommandL( TInt aCommandId ) |
268 void CLocSUPLServerEditor::ProcessCommandL( TInt aCommandId ) |
268 { |
269 { |
269 DEBUG1( + CLocSUPLServerEditor::ProcessCommandL aCommandId=%d, aCommandId ); |
270 DEBUG1( + CLocSUPLServerEditor::ProcessCommandL aCommandId=%d, aCommandId ); |
270 CAknForm::ProcessCommandL( aCommandId ); |
271 CAknForm::ProcessCommandL( aCommandId ); |
271 |
272 |
272 switch ( aCommandId ) |
273 switch (aCommandId) |
273 { |
274 { |
274 case EAknFormCmdEdit: |
275 case EAknFormCmdEdit: |
275 { |
276 { |
276 iIsEditMode = ETrue; |
277 iIsEditMode = ETrue; |
277 SetCursorToEndL(); |
278 SetCursorToEndL(); |
278 HandleMSKCaptionL(); |
279 HandleMSKCaptionL(); |
279 break; |
280 break; |
280 } |
281 } |
281 case ELocServerEditorDelete: |
282 case ELocServerEditorDelete: |
282 case ELocServerEditorRemove: |
283 case ELocServerEditorRemove: |
283 { |
284 { |
284 if( DeleteConfirmationQueryL() ) |
285 if (DeleteConfirmationQueryL()) |
285 { |
286 { |
286 TRAP_IGNORE( iEngine.RemoveServerL( iSlpId ) ); |
287 TRAP_IGNORE( iEngine.RemoveServerL( iSlpId ) ); |
287 // Return back to server view |
288 // Return back to server view |
288 TryExitL( EAknSoftkeyBack ); |
289 TryExitL(EAknSoftkeyBack); |
289 } |
290 } |
290 break; |
291 break; |
291 } |
292 } |
292 case ELocServerEditorDisable: |
293 case ELocServerEditorDisable: |
293 { |
294 { |
294 TRAP_IGNORE( iEngine.SetServerEnabledFlagL( iSlpId, EFalse ) ); |
295 TRAP_IGNORE( iEngine.SetServerEnabledFlagL( iSlpId, EFalse ) ); |
295 break; |
296 break; |
296 } |
297 } |
297 case ELocServerEditorEnable: |
298 case ELocServerEditorEnable: |
298 { |
299 { |
299 TRAP_IGNORE( iEngine.SetServerEnabledFlagL( iSlpId, ETrue ) ); |
300 TRAP_IGNORE( iEngine.SetServerEnabledFlagL( iSlpId, ETrue ) ); |
300 break; |
301 break; |
301 } |
302 } |
302 case ELocServerEditorDefine: |
303 case ELocServerEditorDefine: |
303 { |
304 { |
304 TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
305 TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
305 break; |
306 break; |
306 } |
307 } |
307 case ELocServerEditorChange: |
308 case ELocServerEditorChange: |
308 case ELocServerEditorMSKChange: |
309 case ELocServerEditorMSKChange: |
309 { |
310 { |
310 if ( IdOfFocusControl() == ELocSuplServerIdAccessPoint ) |
311 CEikEdwin* usageInHomeNWPopupFieldText = (CEikEdwin*) Control( |
311 { |
312 ELocSuplServerIdUsageInHomeNw); |
312 TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
313 if (IdOfFocusControl() == ELocSuplServerIdAccessPoint) |
313 } |
314 { |
314 else |
315 TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
315 { |
316 } |
316 if( iIsNewServer ) |
317 else |
317 { |
318 { |
318 TogglePopupFieldControlL( IdOfFocusControl() ); |
319 if (iIsNewServer) |
319 } |
320 { |
320 else |
321 TBuf<KMaxUsageTextSize> des; |
321 { |
322 usageInHomeNWPopupFieldText->GetText(des); |
322 TBool editableFlag; |
323 if (!des.Compare(KNoUsageInHomeNetork)) |
323 TRAP_IGNORE( iEngine.GetEditableFlagL( iSlpId, editableFlag ) ); |
324 { |
324 if ( editableFlag ) |
325 SetUsageinHomeNetwork(ETrue); |
325 TogglePopupFieldControlL( IdOfFocusControl() ); |
326 } |
326 } |
327 else |
327 } |
328 { |
328 break; |
329 SetUsageinHomeNetwork(EFalse); |
329 } |
330 } |
330 case EAknCmdHelp: |
331 } |
331 { |
332 else |
332 break; |
333 { |
333 } |
334 TBool editableFlag; |
334 case EEikCmdExit: |
335 TRAP_IGNORE( iEngine.GetEditableFlagL( iSlpId, editableFlag ) ); |
335 { |
336 if (editableFlag) |
336 // The Exit is handled by the Application UI |
337 { |
337 TryExitL( EEikCmdExit ); |
338 TBuf<KMaxUsageTextSize> des; |
338 break; |
339 usageInHomeNWPopupFieldText->GetText(des); |
339 } |
340 if (!des.Compare(KNoUsageInHomeNetork)) |
340 default: |
341 { |
341 break; |
342 SetUsageinHomeNetwork(ETrue); |
342 } |
343 } |
343 DEBUG( - CLocSUPLServerEditor::ProcessCommandL ); |
344 else |
344 } |
345 { |
345 |
346 SetUsageinHomeNetwork(EFalse); |
|
347 } |
|
348 } |
|
349 } |
|
350 } |
|
351 break; |
|
352 } |
|
353 case EAknCmdHelp: |
|
354 { |
|
355 HlpLauncher::LaunchHelpApplicationL(iCoeEnv->WsSession(), |
|
356 iAvkonAppUi->AppHelpContextL()); |
|
357 break; |
|
358 } |
|
359 case EEikCmdExit: |
|
360 { |
|
361 // The Exit is handled by the Application UI |
|
362 TryExitL(EEikCmdExit); |
|
363 break; |
|
364 } |
|
365 default: |
|
366 break; |
|
367 }DEBUG( - CLocSUPLServerEditor::ProcessCommandL ); |
|
368 } |
|
369 |
346 // --------------------------------------------------------------------------- |
370 // --------------------------------------------------------------------------- |
347 // Derived from CEikDialog |
371 // Derived from CEikDialog |
348 // --------------------------------------------------------------------------- |
372 // --------------------------------------------------------------------------- |
349 |
373 |
350 // ----------------------------------------------------------------------------- |
|
351 // CLocSUPLServerEditor::HandlePointerEventL |
|
352 // ----------------------------------------------------------------------------- |
|
353 // |
|
354 void CLocSUPLServerEditor::HandlePointerEventL(const TPointerEvent &aPointerEvent) |
|
355 { |
|
356 DEBUG( +CLocSUPLServerEditor::HandlePointerEventL ); |
|
357 CEikEdwin* serverAddress = static_cast<CEikEdwin*> (ControlOrNull( |
|
358 ELocSuplServerIdServerAddr)); |
|
359 CEikEdwin* iapEditor = static_cast<CEikEdwin*> (ControlOrNull( |
|
360 ELocSuplServerIdAccessPoint)); |
|
361 CAknPopupFieldText* usageInHomeNWPopupFieldText = |
|
362 (CAknPopupFieldText*) Control(ELocSuplServerIdUsageInHomeNw); |
|
363 |
|
364 if (!IsEditable()) |
|
365 { |
|
366 CAknForm::HandlePointerEventL(aPointerEvent); |
|
367 |
|
368 if(aPointerEvent.iType == TPointerEvent::EButton1Up) |
|
369 { |
|
370 // Opens the editor on Single Click on any of the controls. Click on rest of the click does not repond |
|
371 if (iapEditor->Rect().Contains(aPointerEvent.iPosition) |
|
372 || usageInHomeNWPopupFieldText->Rect().Contains( |
|
373 aPointerEvent.iPosition) |
|
374 || serverAddress->Rect().Contains(aPointerEvent.iPosition)) |
|
375 { |
|
376 ProcessCommandL(EAknFormCmdEdit); |
|
377 } |
|
378 } |
|
379 } |
|
380 else if (IsEditable()) |
|
381 { |
|
382 if (usageInHomeNWPopupFieldText ) |
|
383 { |
|
384 if (usageInHomeNWPopupFieldText->Rect().Contains( |
|
385 aPointerEvent.iPosition) ) |
|
386 { |
|
387 if( aPointerEvent.iType == TPointerEvent::EButton1Down ) |
|
388 { |
|
389 TogglePopupFieldControlL(IdOfFocusControl()); |
|
390 if (iIsNewServer) |
|
391 { |
|
392 iIsModified = ETrue; |
|
393 } |
|
394 } |
|
395 return; |
|
396 } |
|
397 } |
|
398 |
|
399 CAknForm::HandlePointerEventL(aPointerEvent); |
|
400 |
|
401 //check if click is on IAP Editor control |
|
402 if (iapEditor) |
|
403 { |
|
404 if (iapEditor->Rect().Contains(aPointerEvent.iPosition) && |
|
405 aPointerEvent.iType == TPointerEvent::EButton1Up ) |
|
406 { |
|
407 //Launch IAP Dialog |
|
408 TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
|
409 return; |
|
410 } |
|
411 } |
|
412 } |
|
413 DEBUG( - CLocSUPLServerEditor::HandlePointerEventL ); |
|
414 } |
|
415 |
|
416 |
|
417 // ----------------------------------------------------------------------------- |
374 // ----------------------------------------------------------------------------- |
418 // CLocSUPLServerEditor::OfferKeyEventL |
375 // CLocSUPLServerEditor::OfferKeyEventL |
419 // Receives and handles key events |
376 // Receives and handles key events |
420 // ----------------------------------------------------------------------------- |
377 // ----------------------------------------------------------------------------- |
421 // |
378 // |
1127 } |
1118 } |
1128 delete address; |
1119 delete address; |
1129 } |
1120 } |
1130 } |
1121 } |
1131 } |
1122 } |
|
1123 // ---------------------------------------------------------------------------------- |
|
1124 // CLocSUPLServerEditor::HandleDialogPageEventL |
|
1125 // ---------------------------------------------------------------------------------- |
|
1126 // |
|
1127 void CLocSUPLServerEditor::HandleDialogPageEventL(TInt aEventID) |
|
1128 { |
|
1129 DEBUG( +CLocSUPLServerEditor::HandleDialogPageEventL ); |
|
1130 |
|
1131 CAknForm::HandleDialogPageEventL(aEventID); |
|
1132 CEikEdwin* iapEditor = static_cast<CEikEdwin*> (ControlOrNull( |
|
1133 ELocSuplServerIdAccessPoint)); |
|
1134 CEikEdwin* usageInHomeNWPopupFieldText = (CEikEdwin*) Control( |
|
1135 ELocSuplServerIdUsageInHomeNw); |
|
1136 TInt focusControl(IdOfFocusControl()); |
|
1137 |
|
1138 if (!IsEditable()) |
|
1139 { |
|
1140 if (focusControl == ELocSuplServerIdUsageInHomeNw |
|
1141 || ELocSuplServerIdServerAddr || ELocSuplServerIdAccessPoint) |
|
1142 { |
|
1143 ProcessCommandL(EAknFormCmdEdit); |
|
1144 } |
|
1145 } |
|
1146 else if (aEventID == MEikDialogPageObserver::EDialogPageTapped) |
|
1147 { |
|
1148 if (focusControl == ELocSuplServerIdUsageInHomeNw) |
|
1149 { |
|
1150 if (usageInHomeNWPopupFieldText) |
|
1151 { |
|
1152 TBuf<KMaxUsageTextSize> des; |
|
1153 usageInHomeNWPopupFieldText->GetText(des); |
|
1154 if (!des.Compare(KNoUsageInHomeNetork)) |
|
1155 { |
|
1156 SetUsageinHomeNetwork(ETrue); |
|
1157 } |
|
1158 else |
|
1159 { |
|
1160 SetUsageinHomeNetwork(EFalse); |
|
1161 } |
|
1162 if (iIsNewServer) |
|
1163 { |
|
1164 iIsModified = ETrue; |
|
1165 } |
|
1166 } |
|
1167 return; |
|
1168 } |
|
1169 if (focusControl == ELocSuplServerIdAccessPoint) |
|
1170 { |
|
1171 if (iapEditor) |
|
1172 { |
|
1173 //Launch IAP Dialog |
|
1174 TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
|
1175 } |
|
1176 } |
|
1177 }DEBUG( -CLocSUPLServerEditor::HandleDialogPageEventL ); |
|
1178 } |
|
1179 |
|
1180 // ----------------------------------------------------------------------------- |
|
1181 // CLocSUPLServerEditor::SetUsageinHomeNetwork |
|
1182 // Set usage in network field on or off |
|
1183 // ----------------------------------------------------------------------------- |
|
1184 // |
|
1185 void CLocSUPLServerEditor::SetUsageinHomeNetwork(TBool aOnOff) |
|
1186 { |
|
1187 HBufC* string; |
|
1188 CEikEdwin* usageInHomeNWPopupFieldText = (CEikEdwin*) Control( |
|
1189 ELocSuplServerIdUsageInHomeNw); |
|
1190 if (aOnOff) |
|
1191 { |
|
1192 // load string 'ON' |
|
1193 string = StringLoader::LoadLC(R_LOC_SERVER_USAGEINHOMENETWORK_YES, |
|
1194 iCoeEnv); |
|
1195 } |
|
1196 else |
|
1197 { |
|
1198 // load string 'OFF' |
|
1199 string = StringLoader::LoadLC(R_LOC_SERVER_USAGEINHOMENETWORK_NO, |
|
1200 iCoeEnv); |
|
1201 } |
|
1202 // set Usage in Network field string as 'ON'/'OFF' |
|
1203 usageInHomeNWPopupFieldText->SetTextL(string); |
|
1204 CleanupStack::PopAndDestroy(string); |
|
1205 } |
1132 |
1206 |
1133 // End of file |
1207 // End of file |