268 void CLocSUPLServerEditor::ProcessCommandL( TInt aCommandId ) |
268 void CLocSUPLServerEditor::ProcessCommandL( TInt aCommandId ) |
269 { |
269 { |
270 DEBUG1( + CLocSUPLServerEditor::ProcessCommandL aCommandId=%d, aCommandId ); |
270 DEBUG1( + CLocSUPLServerEditor::ProcessCommandL aCommandId=%d, aCommandId ); |
271 CAknForm::ProcessCommandL( aCommandId ); |
271 CAknForm::ProcessCommandL( aCommandId ); |
272 |
272 |
273 switch ( aCommandId ) |
273 switch (aCommandId) |
274 { |
274 { |
275 case EAknFormCmdEdit: |
275 case EAknFormCmdEdit: |
276 { |
276 { |
277 iIsEditMode = ETrue; |
277 iIsEditMode = ETrue; |
278 SetCursorToEndL(); |
278 SetCursorToEndL(); |
279 HandleMSKCaptionL(); |
279 HandleMSKCaptionL(); |
280 break; |
280 break; |
281 } |
281 } |
282 case ELocServerEditorDelete: |
282 case ELocServerEditorDelete: |
283 case ELocServerEditorRemove: |
283 case ELocServerEditorRemove: |
284 { |
284 { |
285 if( DeleteConfirmationQueryL() ) |
285 if (DeleteConfirmationQueryL()) |
286 { |
286 { |
287 TRAP_IGNORE( iEngine.RemoveServerL( iSlpId ) ); |
287 TRAP_IGNORE( iEngine.RemoveServerL( iSlpId ) ); |
288 // Return back to server view |
288 // Return back to server view |
289 TryExitL( EAknSoftkeyBack ); |
289 TryExitL(EAknSoftkeyBack); |
290 } |
290 } |
291 break; |
291 break; |
292 } |
292 } |
293 case ELocServerEditorDisable: |
293 case ELocServerEditorDisable: |
294 { |
294 { |
295 TRAP_IGNORE( iEngine.SetServerEnabledFlagL( iSlpId, EFalse ) ); |
295 TRAP_IGNORE( iEngine.SetServerEnabledFlagL( iSlpId, EFalse ) ); |
296 break; |
296 break; |
297 } |
297 } |
298 case ELocServerEditorEnable: |
298 case ELocServerEditorEnable: |
299 { |
299 { |
300 TRAP_IGNORE( iEngine.SetServerEnabledFlagL( iSlpId, ETrue ) ); |
300 TRAP_IGNORE( iEngine.SetServerEnabledFlagL( iSlpId, ETrue ) ); |
301 break; |
301 break; |
302 } |
302 } |
303 case ELocServerEditorDefine: |
303 case ELocServerEditorDefine: |
304 { |
304 { |
305 TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
305 TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
306 break; |
306 break; |
307 } |
307 } |
308 case ELocServerEditorChange: |
308 case ELocServerEditorChange: |
309 case ELocServerEditorMSKChange: |
309 case ELocServerEditorMSKChange: |
310 { |
310 { |
311 if ( IdOfFocusControl() == ELocSuplServerIdAccessPoint ) |
311 CEikEdwin* usageInHomeNWPopupFieldText = (CEikEdwin*) Control( |
312 { |
312 ELocSuplServerIdUsageInHomeNw); |
313 TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
313 if (IdOfFocusControl() == ELocSuplServerIdAccessPoint) |
314 } |
314 { |
315 else |
315 TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
316 { |
316 } |
317 if( iIsNewServer ) |
317 else |
318 { |
318 { |
319 TogglePopupFieldControlL( IdOfFocusControl() ); |
319 if (iIsNewServer) |
320 } |
320 { |
321 else |
321 TBuf<KMaxUsageTextSize> des; |
322 { |
322 usageInHomeNWPopupFieldText->GetText(des); |
323 TBool editableFlag; |
323 if (!des.Compare(KNoUsageInHomeNetork)) |
324 TRAP_IGNORE( iEngine.GetEditableFlagL( iSlpId, editableFlag ) ); |
324 { |
325 if ( editableFlag ) |
325 SetUsageinHomeNetwork(ETrue); |
326 TogglePopupFieldControlL( IdOfFocusControl() ); |
326 } |
327 } |
327 else |
328 } |
328 { |
329 break; |
329 SetUsageinHomeNetwork(EFalse); |
330 } |
330 } |
331 case EAknCmdHelp: |
331 } |
332 { |
332 else |
333 HlpLauncher::LaunchHelpApplicationL( iCoeEnv->WsSession(), |
333 { |
334 iAvkonAppUi->AppHelpContextL() ); |
334 TBool editableFlag; |
335 break; |
335 TRAP_IGNORE( iEngine.GetEditableFlagL( iSlpId, editableFlag ) ); |
336 } |
336 if (editableFlag) |
337 case EEikCmdExit: |
337 { |
338 { |
338 TBuf<KMaxUsageTextSize> des; |
339 // The Exit is handled by the Application UI |
339 usageInHomeNWPopupFieldText->GetText(des); |
340 TryExitL( EEikCmdExit ); |
340 if (!des.Compare(KNoUsageInHomeNetork)) |
341 break; |
341 { |
342 } |
342 SetUsageinHomeNetwork(ETrue); |
343 default: |
343 } |
344 break; |
344 else |
345 } |
345 { |
346 DEBUG( - CLocSUPLServerEditor::ProcessCommandL ); |
346 SetUsageinHomeNetwork(EFalse); |
347 } |
347 } |
348 |
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 |
349 // --------------------------------------------------------------------------- |
370 // --------------------------------------------------------------------------- |
350 // Derived from CEikDialog |
371 // Derived from CEikDialog |
351 // --------------------------------------------------------------------------- |
372 // --------------------------------------------------------------------------- |
352 |
373 |
353 // ----------------------------------------------------------------------------- |
|
354 // CLocSUPLServerEditor::HandlePointerEventL |
|
355 // ----------------------------------------------------------------------------- |
|
356 // |
|
357 void CLocSUPLServerEditor::HandlePointerEventL(const TPointerEvent &aPointerEvent) |
|
358 { |
|
359 DEBUG( +CLocSUPLServerEditor::HandlePointerEventL ); |
|
360 CEikEdwin* serverAddress = static_cast<CEikEdwin*> (ControlOrNull( |
|
361 ELocSuplServerIdServerAddr)); |
|
362 CEikEdwin* iapEditor = static_cast<CEikEdwin*> (ControlOrNull( |
|
363 ELocSuplServerIdAccessPoint)); |
|
364 CAknPopupFieldText* usageInHomeNWPopupFieldText = |
|
365 (CAknPopupFieldText*) Control(ELocSuplServerIdUsageInHomeNw); |
|
366 |
|
367 if (!IsEditable()) |
|
368 { |
|
369 CAknForm::HandlePointerEventL(aPointerEvent); |
|
370 |
|
371 if(aPointerEvent.iType == TPointerEvent::EButton1Up) |
|
372 { |
|
373 // Opens the editor on Single Click on any of the controls. Click on rest of the click does not repond |
|
374 if (iapEditor->Rect().Contains(aPointerEvent.iPosition) |
|
375 || usageInHomeNWPopupFieldText->Rect().Contains( |
|
376 aPointerEvent.iPosition) |
|
377 || serverAddress->Rect().Contains(aPointerEvent.iPosition)) |
|
378 { |
|
379 ProcessCommandL(EAknFormCmdEdit); |
|
380 } |
|
381 } |
|
382 } |
|
383 else if (IsEditable()) |
|
384 { |
|
385 if (usageInHomeNWPopupFieldText ) |
|
386 { |
|
387 if (usageInHomeNWPopupFieldText->Rect().Contains( |
|
388 aPointerEvent.iPosition) ) |
|
389 { |
|
390 if( aPointerEvent.iType == TPointerEvent::EButton1Down ) |
|
391 { |
|
392 TogglePopupFieldControlL(IdOfFocusControl()); |
|
393 if (iIsNewServer) |
|
394 { |
|
395 iIsModified = ETrue; |
|
396 } |
|
397 } |
|
398 return; |
|
399 } |
|
400 } |
|
401 |
|
402 CAknForm::HandlePointerEventL(aPointerEvent); |
|
403 |
|
404 //check if click is on IAP Editor control |
|
405 if (iapEditor) |
|
406 { |
|
407 if (iapEditor->Rect().Contains(aPointerEvent.iPosition) && |
|
408 aPointerEvent.iType == TPointerEvent::EButton1Up ) |
|
409 { |
|
410 //Launch IAP Dialog |
|
411 TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
|
412 return; |
|
413 } |
|
414 } |
|
415 } |
|
416 DEBUG( - CLocSUPLServerEditor::HandlePointerEventL ); |
|
417 } |
|
418 |
|
419 |
|
420 // ----------------------------------------------------------------------------- |
374 // ----------------------------------------------------------------------------- |
421 // CLocSUPLServerEditor::OfferKeyEventL |
375 // CLocSUPLServerEditor::OfferKeyEventL |
422 // Receives and handles key events |
376 // Receives and handles key events |
423 // ----------------------------------------------------------------------------- |
377 // ----------------------------------------------------------------------------- |
424 // |
378 // |
1150 } |
1118 } |
1151 delete address; |
1119 delete address; |
1152 } |
1120 } |
1153 } |
1121 } |
1154 } |
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 } |
1155 |
1206 |
1156 // End of file |
1207 // End of file |