# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1272375494 -10800 # Node ID 0004e923f486cb4b8f594075d9eca30d079a6545 # Parent f73067c3e563d11dbe2f1cb769bdc304211b9d82 Revision: 201015 Kit: 201017 diff -r f73067c3e563 -r 0004e923f486 fmradio/fmradio/src/fmradioappui.cpp --- a/fmradio/fmradio/src/fmradioappui.cpp Wed Apr 14 15:57:41 2010 +0300 +++ b/fmradio/fmradio/src/fmradioappui.cpp Tue Apr 27 16:38:14 2010 +0300 @@ -431,15 +431,6 @@ #endif } break; - case EFMRadioCmdScanLocalStationsViewActive: - iLayoutChangeObserver = iScanLocalStationsView; - break; - case EFMRadioCmdChannelListViewActive: - iLayoutChangeObserver = iChannelListView; - break; - case EFMRadioCmdMainViewActive: - iLayoutChangeObserver = iMainView; - break; default: break; } @@ -459,6 +450,15 @@ } switch ( aCommand ) { + case EFMRadioCmdScanLocalStationsViewActive: + iLayoutChangeObserver = iScanLocalStationsView; + break; + case EFMRadioCmdChannelListViewActive: + iLayoutChangeObserver = iChannelListView; + break; + case EFMRadioCmdMainViewActive: + iLayoutChangeObserver = iMainView; + break; case EAknSoftkeyExit: case EEikCmdExit: case EAknCmdExit: diff -r f73067c3e563 -r 0004e923f486 fmradio/fmradio/src/fmradiochannellistcontainer.cpp --- a/fmradio/fmradio/src/fmradiochannellistcontainer.cpp Wed Apr 14 15:57:41 2010 +0300 +++ b/fmradio/fmradio/src/fmradiochannellistcontainer.cpp Tue Apr 27 16:38:14 2010 +0300 @@ -223,60 +223,57 @@ // values specified // ---------------------------------------------------- // -void CFMRadioChannelListContainer::UpdateChannelListContentL( TInt aIndex, const TDesC& aChannelName, TInt aChannelFrequency ) - { +void CFMRadioChannelListContainer::UpdateChannelListContentL( TInt aIndex, + const TDesC& aChannelName, + TInt aChannelFrequency ) + { TBuf textChannelItem; TBuf textChIndex; TBuf textChIconIndex; - + textChIndex.Format( KChIndexFormatChList, aIndex+1 ); // One over index - + textChIconIndex.Format( KChIconIndexFormatChList, KNowPlayingIconIndexChList ); + + //Update to display Devnagari numbers for Text Index. + AknTextUtils::LanguageSpecificNumberConversion( textChIndex ); - //Update to display Devnagari numbers for Text Index. - AknTextUtils::LanguageSpecificNumberConversion( textChIndex ); - // textChannelItem.Append( textChIndex ); textChannelItem.Append( KColumnListSeparator ); textChannelItem.Append( aChannelName ); textChannelItem.Append( KColumnListSeparator ); if ( aChannelFrequency ) - { - TReal frequency = static_cast( aChannelFrequency / static_cast( KHzConversionFactor )); - // Gets locale decimal separator automatically - TRealFormat format(KFrequencyMaxLength, iRadioEngine.DecimalCount() ); - TBuf<30> frequencyString; - frequencyString.Num( frequency, format ); - - HBufC* stringHolder = StringLoader::LoadLC( R_QTN_FMRADIO_DOUBLE2_FREQ, frequencyString, iEikonEnv ); - //Update for display of Hindi Devnagari Numbers - TPtr textItem2 = stringHolder->Des(); - AknTextUtils::LanguageSpecificNumberConversion(textItem2); - textChannelItem.Append( textItem2 ); - CleanupStack::PopAndDestroy( stringHolder ); - } + { + TReal frequency = static_cast( aChannelFrequency / static_cast( KHzConversionFactor )); + // Gets locale decimal separator automatically + TRealFormat format(KFrequencyMaxLength, iRadioEngine.DecimalCount() ); + TBuf<30> frequencyString; + frequencyString.Num( frequency, format ); + + HBufC* stringHolder = StringLoader::LoadLC( R_QTN_FMRADIO_DOUBLE2_FREQ, frequencyString, iEikonEnv ); + //Update for display of Hindi Devnagari Numbers + TPtr textItem2 = stringHolder->Des(); + AknTextUtils::LanguageSpecificNumberConversion(textItem2); + textChannelItem.Append( textItem2 ); + CleanupStack::PopAndDestroy( stringHolder ); + } // Set 'Now Playing' icon to the channel item textChannelItem.Append( KColumnListSeparator ); - + if ( iRadioEngine.GetPresetIndex() == aIndex ) - { + { textChannelItem.Append( textChIconIndex ); - } + } - if( iChannelItemArray->Count() > 0 ) - { - iChannelItemArray->Delete( aIndex ); - iChannelList->HandleItemRemovalL(); - iChannelItemArray->InsertL( aIndex, textChannelItem ); - //iChannelItemArray->AppendL( textChannelItem ); - - iChannelList->HandleItemAdditionL(); // Update list - iChannelList->UpdateScrollBarsL(); - iChannelList->DrawDeferred(); - } - } + if ( aIndex < iChannelItemArray->Count() && aIndex >= 0 ) + { + iChannelItemArray->Delete( aIndex ); + iChannelItemArray->InsertL( aIndex, textChannelItem ); + iChannelList->DrawDeferred(); + } + } // ---------------------------------------------------- // CFMRadioChannelListContainer::RemoveChannelL @@ -416,11 +413,8 @@ ptr.Append( textChIconIndex ); // Add icon index iChannelItemArray->Delete( aIndex ); - iChannelList->HandleItemRemovalL(); iChannelItemArray->InsertL( aIndex, *channelItem ); CleanupStack::PopAndDestroy( channelItem ); - iChannelList->HandleItemAdditionL(); // Update list - iChannelList->UpdateScrollBarsL(); } // use draw now so that view is up to date during fast channel switching iChannelList->DrawNow(); @@ -447,10 +441,7 @@ { ptr.Delete( ptr.Length() - iconIndexPtr.Length(), iconIndexPtr.Length() ); // Remove icon index iChannelItemArray->Delete( index ); - iChannelList->HandleItemRemovalL(); iChannelItemArray->InsertL( index, *channelItem ); - iChannelList->HandleItemAdditionL(); // Update list - iChannelList->UpdateScrollBarsL(); } CleanupStack::PopAndDestroy( channelItem ); } diff -r f73067c3e563 -r 0004e923f486 fmradio/fmradio/src/fmradiochannellistview.cpp --- a/fmradio/fmradio/src/fmradiochannellistview.cpp Wed Apr 14 15:57:41 2010 +0300 +++ b/fmradio/fmradio/src/fmradiochannellistview.cpp Tue Apr 27 16:38:14 2010 +0300 @@ -721,11 +721,13 @@ // CFMRadioChannelListView::LayoutChangedL // --------------------------------------------------------------------------- // -void CFMRadioChannelListView::LayoutChangedL( - TInt aType ) +void CFMRadioChannelListView::LayoutChangedL( TInt aType ) { - iContainer->SetRect( ClientRect() ); - iContainer->HandleResourceChange( aType ); + if ( iContainer ) + { + iContainer->SetRect( ClientRect() ); + iContainer->HandleResourceChange( aType ); + } } // --------------------------------------------------------------------------------------------- diff -r f73067c3e563 -r 0004e923f486 fmradio/fmradio/src/fmradioscanlocalstationscontainer.cpp --- a/fmradio/fmradio/src/fmradioscanlocalstationscontainer.cpp Wed Apr 14 15:57:41 2010 +0300 +++ b/fmradio/fmradio/src/fmradioscanlocalstationscontainer.cpp Tue Apr 27 16:38:14 2010 +0300 @@ -189,18 +189,19 @@ // values specified // ---------------------------------------------------- // -void CFMRadioScanLocalStationsContainer::UpdateChannelListContentL( TInt aIndex, const TDesC& aInfoText, TInt aChannelFrequency, TBool aNowPlaying, TBool aInfoTextPlacement ) - { +void CFMRadioScanLocalStationsContainer::UpdateChannelListContentL( TInt aIndex, + const TDesC& aInfoText, + TInt aChannelFrequency, + TBool aNowPlaying, + TBool aInfoTextPlacement ) + { TBuf textChannelItem; TBuf textChIndex; TBuf textChIconIndex; - //textChIndex.Format( KChIndexFormatChList, aIndex+1 ); // One over index textChIndex.SetLength( 0 ); - + textChIconIndex.Format( KChIconIndexFormatChList, KNowPlayingIconIndexChList ) ; - //Update to display Devnagari numbers for Text Index. - //AknTextUtils::LanguageSpecificNumberConversion(textChIndex); textChannelItem.Append( textChIndex ); textChannelItem.Append( KColumnListSeparator ); @@ -210,7 +211,7 @@ TBuf<30> frequencyString; frequencyString.Num( frequency, format ); - HBufC* listItemString = NULL; + HBufC* listItemString = NULL; if ( aInfoTextPlacement ) // frequency and PS name { const TInt granularity = 2; @@ -240,24 +241,24 @@ textChannelItem.Append( KColumnListSeparator ); if ( aNowPlaying ) - { - textChannelItem.Append( textChIconIndex ); - } + { + textChannelItem.Append( textChIconIndex ); + } - if( aIndex <= ( iChannelItemArray->Count() - 1 ) ) - { - iChannelItemArray->Delete( aIndex ); - iChannelList->HandleItemRemovalL(); + if ( aIndex < iChannelItemArray->Count() && aIndex >= 0 ) + { + iChannelItemArray->Delete( aIndex ); iChannelItemArray->InsertL( aIndex, textChannelItem ); - } + } else - { + { iChannelItemArray->AppendL( textChannelItem ); - } - iChannelList->HandleItemAdditionL(); // Update list - iChannelList->UpdateScrollBarsL(); - iChannelList->DrawDeferred(); - } + iChannelList->HandleItemAdditionL(); // Update list + iChannelList->UpdateScrollBarsL(); + } + + iChannelList->DrawDeferred(); + } // -------------------------------------------------------------------------------- // CFMRadioScanLocalStationsContainer::InsertScannedChannelToListL diff -r f73067c3e563 -r 0004e923f486 fmradio/fmradiomcpplugin/src/fmradiomcpplugin.cpp --- a/fmradio/fmradiomcpplugin/src/fmradiomcpplugin.cpp Wed Apr 14 15:57:41 2010 +0300 +++ b/fmradio/fmradiomcpplugin/src/fmradiomcpplugin.cpp Tue Apr 27 16:38:14 2010 +0300 @@ -698,7 +698,8 @@ switch( aMuteState ) { case EFMRadioPSMuteStateOn: - if ( iEngine->ApplicationRunningState() != EFMRadioPSApplicationRunning ) + if ( iEngine->ApplicationRunningState() != EFMRadioPSApplicationRunning || + iEngine->AntennaStatus() == EFMRadioPSHeadsetDisconnected ) { UpdatePublishedToolBarL( KFMRadioUnmuteDimmed ); } @@ -709,7 +710,8 @@ break; case EFMRadioPSMuteStateOff: case EFMRadioPSMuteStateUninitialized: - if ( iEngine->ApplicationRunningState() != EFMRadioPSApplicationRunning ) + if ( iEngine->ApplicationRunningState() != EFMRadioPSApplicationRunning || + iEngine->AntennaStatus() == EFMRadioPSHeadsetDisconnected ) { UpdatePublishedToolBarL( KFMRadioMuteDimmed ); }