connectionmonitoring/connectionmonitorui/src/ConnectionMonitorUiContainer.cpp
branchRCL_3
changeset 14 22c3c67e5001
parent 12 4dc3bb0099b0
child 22 984e13af52c4
equal deleted inserted replaced
13:c14618f9de99 14:22c3c67e5001
    74                                   CActiveWrapper* aActiveWrapper )
    74                                   CActiveWrapper* aActiveWrapper )
    75     : CCoeControl(), 
    75     : CCoeControl(), 
    76     iMonitor( aMonitor ),
    76     iMonitor( aMonitor ),
    77     iConnectionArray( aConnectionArray ), 
    77     iConnectionArray( aConnectionArray ), 
    78     isWlanSupported( EFalse ),
    78     isWlanSupported( EFalse ),
    79     iActiveWrapper( aActiveWrapper )
    79     iActiveWrapper( aActiveWrapper ),
       
    80     iFocusChanged( EFalse )
    80     {
    81     {
    81     }
    82     }
    82 
    83 
    83 // ---------------------------------------------------------
    84 // ---------------------------------------------------------
    84 // CConnectionMonitorUiContainer::ConstructL
    85 // CConnectionMonitorUiContainer::ConstructL
   229                 break;
   230                 break;
   230                 }
   231                 }
   231             case EConnMonDeleteConnection:
   232             case EConnMonDeleteConnection:
   232                 {
   233                 {
   233                 CMUILOGGER_WRITE( "OnEventL EConnMonDeleteConnection" );
   234                 CMUILOGGER_WRITE( "OnEventL EConnMonDeleteConnection" );
   234     			CMUILOGGER_WRITE_F( "validIndex: %b", validIndex );
       
   235                 
       
   236                 if ( validIndex )
       
   237                     {
       
   238                     TBool current
       
   239                         ( aIndex == ( TUint )iListBox->CurrentItemIndex() );
       
   240                     AknListBoxUtils::HandleItemRemovalAndPositionHighlightL(
       
   241                                 iListBox, aIndex, ETrue );
       
   242                     }
       
   243                 iListBox->UpdateScrollBarsL();
   235                 iListBox->UpdateScrollBarsL();
   244                 break;
   236                 break;
   245                 }
   237                 }
   246             case EConnMonConnectionStatusChange:
   238             case EConnMonConnectionStatusChange:
   247             case EConnMonCreateSubConnection:
   239             case EConnMonCreateSubConnection:
   271 // ---------------------------------------------------------
   263 // ---------------------------------------------------------
   272 //
   264 //
   273 void CConnectionMonitorUiContainer::OnTimerEventL()
   265 void CConnectionMonitorUiContainer::OnTimerEventL()
   274     {
   266     {
   275     iListBox->DrawNow();
   267     iListBox->DrawNow();
   276     //Update the scrollbar only if connection count has changed
   268     TInt iNewConnectionCount = iConnectionArray->MdcaCount();
       
   269     if ( iOldConnectionCount > iNewConnectionCount )
       
   270         {
       
   271         iListBox->HandleItemRemovalL();
       
   272         }
       
   273     
       
   274     //Update the scrollbar only if lisbox focus 
       
   275     //has changed
   277     //
   276     //
   278     TInt iNewConnectionCount = iConnectionArray->MdcaCount();
   277     if ( iFocusChanged )
   279     if ( iOldConnectionCount != iNewConnectionCount )
       
   280         {
   278         {
   281         iListBox->UpdateScrollBarsL();
   279         iListBox->UpdateScrollBarsL();
       
   280         iFocusChanged = EFalse;
   282         }
   281         }
   283     iOldConnectionCount = iNewConnectionCount;
   282     iOldConnectionCount = iNewConnectionCount;
   284     PushAndRefreshNaviPaneL();
   283     PushAndRefreshNaviPaneL();
   285     }
   284     }
   286 
   285 
   742 // ---------------------------------------------------------
   741 // ---------------------------------------------------------
   743 //
   742 //
   744 void CConnectionMonitorUiContainer::FocusChanged( TDrawNow aDrawNow )
   743 void CConnectionMonitorUiContainer::FocusChanged( TDrawNow aDrawNow )
   745     {
   744     {
   746     CMUILOGGER_ENTERFN( "CConnectionMonitorUiContainer::FocusChanged" );
   745     CMUILOGGER_ENTERFN( "CConnectionMonitorUiContainer::FocusChanged" );
   747     CCoeControl::FocusChanged( aDrawNow );    
   746     CCoeControl::FocusChanged( aDrawNow ); 
       
   747     iFocusChanged = ETrue;     
   748     if ( iListBox )
   748     if ( iListBox )
   749         {
   749         {
   750         iListBox->SetFocus( IsFocused() );
   750         iListBox->SetFocus( IsFocused() );
   751         }        
   751         }        
   752     CMUILOGGER_LEAVEFN( "CConnectionMonitorUiContainer::FocusChanged" );    
   752     CMUILOGGER_LEAVEFN( "CConnectionMonitorUiContainer::FocusChanged" );