connectionmonitoring/connectionmonitorui/src/ConnectionMonitorUiContainer.cpp
branchRCL_3
changeset 19 22c3c67e5001
parent 15 4dc3bb0099b0
child 54 984e13af52c4
--- a/connectionmonitoring/connectionmonitorui/src/ConnectionMonitorUiContainer.cpp	Wed Apr 14 16:22:04 2010 +0300
+++ b/connectionmonitoring/connectionmonitorui/src/ConnectionMonitorUiContainer.cpp	Tue Apr 27 17:03:25 2010 +0300
@@ -76,7 +76,8 @@
     iMonitor( aMonitor ),
     iConnectionArray( aConnectionArray ), 
     isWlanSupported( EFalse ),
-    iActiveWrapper( aActiveWrapper )
+    iActiveWrapper( aActiveWrapper ),
+    iFocusChanged( EFalse )
     {
     }
 
@@ -231,15 +232,6 @@
             case EConnMonDeleteConnection:
                 {
                 CMUILOGGER_WRITE( "OnEventL EConnMonDeleteConnection" );
-    			CMUILOGGER_WRITE_F( "validIndex: %b", validIndex );
-                
-                if ( validIndex )
-                    {
-                    TBool current
-                        ( aIndex == ( TUint )iListBox->CurrentItemIndex() );
-                    AknListBoxUtils::HandleItemRemovalAndPositionHighlightL(
-                                iListBox, aIndex, ETrue );
-                    }
                 iListBox->UpdateScrollBarsL();
                 break;
                 }
@@ -273,12 +265,19 @@
 void CConnectionMonitorUiContainer::OnTimerEventL()
     {
     iListBox->DrawNow();
-    //Update the scrollbar only if connection count has changed
+    TInt iNewConnectionCount = iConnectionArray->MdcaCount();
+    if ( iOldConnectionCount > iNewConnectionCount )
+        {
+        iListBox->HandleItemRemovalL();
+        }
+    
+    //Update the scrollbar only if lisbox focus 
+    //has changed
     //
-    TInt iNewConnectionCount = iConnectionArray->MdcaCount();
-    if ( iOldConnectionCount != iNewConnectionCount )
+    if ( iFocusChanged )
         {
         iListBox->UpdateScrollBarsL();
+        iFocusChanged = EFalse;
         }
     iOldConnectionCount = iNewConnectionCount;
     PushAndRefreshNaviPaneL();
@@ -744,7 +743,8 @@
 void CConnectionMonitorUiContainer::FocusChanged( TDrawNow aDrawNow )
     {
     CMUILOGGER_ENTERFN( "CConnectionMonitorUiContainer::FocusChanged" );
-    CCoeControl::FocusChanged( aDrawNow );    
+    CCoeControl::FocusChanged( aDrawNow ); 
+    iFocusChanged = ETrue;     
     if ( iListBox )
         {
         iListBox->SetFocus( IsFocused() );