diff -r ba54057fe027 -r b68fcd923911 phoneuis/dialer/src/cdialer.cpp --- a/phoneuis/dialer/src/cdialer.cpp Tue May 11 16:13:03 2010 +0300 +++ b/phoneuis/dialer/src/cdialer.cpp Tue May 25 12:41:50 2010 +0300 @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include // for KDC_APP_RESOURCE_DIR @@ -35,6 +36,7 @@ #include #include #include +#include #include #include "cdialer.h" @@ -137,6 +139,9 @@ SetRect( aRect ); SetComponentsToInheritVisibility( EFalse ); + + // By default, numeric keysounds are disabled. + DisableNumericKeySounds( ETrue ); ActivateL(); #ifdef RD_SCALABLE_UI_V2 @@ -260,6 +265,10 @@ } UpdateEdwinState( editorType ); + + // Numeric keysound are disabled in if not in alpha mode. + // In numeric mode numeric keys should play DTMF only. + DisableNumericKeySounds( editorType != EAlphanumericEditor ); } // --------------------------------------------------------------------------- @@ -831,6 +840,30 @@ } // --------------------------------------------------------------------------- +// CDialer::SetNumericKeySounds +// --------------------------------------------------------------------------- +// +void CDialer::DisableNumericKeySounds( TBool aDisable ) + { + CAknAppUi *appUi = static_cast( ControlEnv()->AppUi() ); + CAknKeySoundSystem* keySounds = appUi->KeySounds(); + + if ( aDisable && !iNumericKeySoundsDisabled ) + { + // Disable numeric key sounds. This is done only if key sounds were not disabled previously, + // to avoid situation that there were multiple key sound contexts in the stack. + TRAP_IGNORE( keySounds->PushContextL( R_PHONEUI_DEFAULT_SKEY_LIST ) ); + } + else if ( !aDisable && iNumericKeySoundsDisabled ) + { + // Remove numeric key sound disabling. + keySounds->PopContext(); + } + + iNumericKeySoundsDisabled = aDisable; + } + +// --------------------------------------------------------------------------- // CDialer::LoadEasyDialingPlugin // --------------------------------------------------------------------------- //