--- a/phoneapp/phoneuivoipextension/src/cphonecustomizationvoip.cpp Wed Sep 15 12:12:21 2010 +0300
+++ b/phoneapp/phoneuivoipextension/src/cphonecustomizationvoip.cpp Wed Oct 13 14:31:22 2010 +0300
@@ -802,7 +802,9 @@
__LOGMETHODSTARTEND( PhoneUIVoIPExtension,
"CPhoneCustomizationVoip::ModifyNumberAcquisitionMenuL");
- if ( aResourceId == R_PHONEUI_NUMBERACQ_OPTIONS_CALL_MENU &&
+ if ( ( aResourceId == R_PHONEUI_NUMBERACQ_OPTIONS_CALL_MENU ||
+ aResourceId == R_PHONEUI_NUMBERACQ_OPTIONS_MENU ||
+ aResourceId == R_PHONEUIDIALER_OPTIONS_MENU ) &&
VoIPSupportedL() )
{
InsertInternetCallMenuItemL( aResourceId, aMenuPane );
@@ -823,7 +825,7 @@
// -----------------------------------------------------------
//
void CPhoneCustomizationVoip::InsertInternetCallMenuItemL(
- TInt /* aResourceId */, CEikMenuPane& aMenuPane )
+ TInt aResourceId, CEikMenuPane& aMenuPane )
{
__LOGMETHODSTARTEND( PhoneUIVoIPExtension,
"CPhoneCustomizationVoip::InsertInternetCallMenuItemL" );
@@ -851,11 +853,38 @@
HBufC* phoneNumber = PhoneNumberFromEntryLC();
- // If number entry is empty don't add internet call option
- if ( phoneNumber->Length() )
+ TInt index(KErrNotFound);
+
+ if ( aResourceId == R_PHONEUI_NUMBERACQ_OPTIONS_CALL_MENU )
{
+ if ( !CPhoneKeys::Validate( phoneNumber->Des() ) )
+ {
+ if ( aMenuPane.MenuItemExists( EPhoneNumberAcqCmdCall, index ) )
+ {
+ aMenuPane.DeleteMenuItem( EPhoneNumberAcqCmdCall );
+ }
+
+ if ( aMenuPane.MenuItemExists( EPhoneNumberAcqCmdVideoCall, index ) )
+ {
+ aMenuPane.DeleteMenuItem( EPhoneNumberAcqCmdVideoCall );
+ }
+ }
+
aMenuPane.AddMenuItemL( voipMenuItem->iData );
}
+ else if ( !aMenuPane.MenuItemExists( EPhoneNumberAcqCmdCall, index ) )
+ {
+ // Call menu is removed if user inserts anything that is not
+ // a valid cs number, so must add Internet call option here where
+ // we know that voip is however supported.
+
+ // If number entry is empty don't add internet call option
+ if ( phoneNumber->Length() )
+ {
+ // Internet call item must be on the top of the menu
+ aMenuPane.InsertMenuItemL( voipMenuItem->iData, 0 );
+ }
+ }
CleanupStack::PopAndDestroy( 3, &voipServices );
}