videocollection/hgmyvideos/src/vcxhgmyvideosvideolistimpl.cpp
branchRCL_3
changeset 15 8f0df5c82986
parent 12 7f2b2a65da29
child 18 baf439b22ddd
equal deleted inserted replaced
14:55fa1ec415c6 15:8f0df5c82986
   193 // -----------------------------------------------------------------------------
   193 // -----------------------------------------------------------------------------
   194 //
   194 //
   195 void CVcxHgMyVideosVideoListImpl::DoListActivateL( TInt aIndex )
   195 void CVcxHgMyVideosVideoListImpl::DoListActivateL( TInt aIndex )
   196     {
   196     {
   197     TInt index = aIndex;
   197     TInt index = aIndex;
   198     index = ( ( index != KErrNotFound ) ? index : iVideoModel->CurrentCategoryIndex() );
   198     TInt currentIndex = iVideoModel->CurrentCategoryIndex();
       
   199     index = ( ( index != KErrNotFound ) ? index : currentIndex );
   199     index = ( ( index != KErrNotFound ) ? index : 0 );
   200     index = ( ( index != KErrNotFound ) ? index : 0 );
   200 
   201 
   201     iVideoModel->UpdateVideoListL( index );
   202     iVideoModel->UpdateVideoListL( index );
   202     
   203     
   203     iVideoModel->DoModelActivateL();
   204     iVideoModel->DoModelActivateL();
   204     CVcxHgMyVideosListBase::DoListActivateL( index );
   205     CVcxHgMyVideosListBase::DoListActivateL( index );
       
   206     if ( index != currentIndex )
       
   207         {
       
   208         // Prevents old list from flickering
       
   209         iScroller->DrawNow();
       
   210         }
   205     iScroller->SetFocus( ETrue );
   211     iScroller->SetFocus( ETrue );
   206     }
   212     }
   207 
   213 
   208 // -----------------------------------------------------------------------------
   214 // -----------------------------------------------------------------------------
   209 // CVcxHgMyVideosVideoListImpl::DoListDeactivate()
   215 // CVcxHgMyVideosVideoListImpl::DoListDeactivate()
   498             }        
   504             }        
   499         break;
   505         break;
   500         }
   506         }
   501     
   507     
   502     CleanupStack::PopAndDestroy( &operationTargets );
   508     CleanupStack::PopAndDestroy( &operationTargets );
   503     }
       
   504 
       
   505 // -----------------------------------------------------------------------------
       
   506 // CVcxHgMyVideosVideoListImpl::ResumeDownloadL()
       
   507 // -----------------------------------------------------------------------------
       
   508 //
       
   509 void CVcxHgMyVideosVideoListImpl::ResumeDownloadL()
       
   510     {
       
   511     iVideoModel->ResumeDownloadL( Highlight() );
       
   512     }
       
   513 
       
   514 // -----------------------------------------------------------------------------
       
   515 // CVcxHgMyVideosVideoListImpl::CancelDownloadL()
       
   516 // -----------------------------------------------------------------------------
       
   517 //
       
   518 void CVcxHgMyVideosVideoListImpl::CancelDownloadL()
       
   519     {
       
   520     iVideoModel->CancelDownloadL( Highlight() );   
       
   521     }
   509     }
   522 
   510 
   523 // -----------------------------------------------------------------------------
   511 // -----------------------------------------------------------------------------
   524 // CVcxHgMyVideosVideoListImpl::HandleSortCommandL()
   512 // CVcxHgMyVideosVideoListImpl::HandleSortCommandL()
   525 // -----------------------------------------------------------------------------
   513 // -----------------------------------------------------------------------------
   850     CleanupClosePushL( markedVideos );
   838     CleanupClosePushL( markedVideos );
   851     
   839     
   852     iVideoModel->MarkedVideosL( markedVideos );
   840     iVideoModel->MarkedVideosL( markedVideos );
   853     TInt highlight = Highlight();
   841     TInt highlight = Highlight();
   854     TInt count = iVideoModel->VideoCount();
   842     TInt count = iVideoModel->VideoCount();
   855     TVcxMyVideosDownloadState dlState( EVcxMyVideosDlStateNone );
   843 
   856     TBool progressivePlay( EFalse );
   844     TBool showPlay = ( ( markedVideos.Count() == 0 ) && ( highlight >= 0 ) && ( count > 0 ) );
   857     if ( count > 0 && highlight >= 0 )
       
   858         {
       
   859         dlState = iVideoModel->VideoDownloadState( highlight );
       
   860         progressivePlay = iVideoModel->IsProgressivePlayPossible( highlight );
       
   861         }
       
   862     TBool showPlay = ( ( markedVideos.Count() == 0 ) && ( highlight >= 0 ) && ( count > 0 )
       
   863                        && ( ( dlState == EVcxMyVideosDlStateNone ) || ( progressivePlay ) ) );
       
   864     
   845     
   865     CleanupStack::PopAndDestroy( &markedVideos );
   846     CleanupStack::PopAndDestroy( &markedVideos );
   866     
   847     
   867     if ( showPlay )
   848     if ( showPlay )
   868         {
   849         {
   936     IPTVLOGSTRING2_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::HandleSendL() targets count: %d", operationTargets.Count() );
   917     IPTVLOGSTRING2_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::HandleSendL() targets count: %d", operationTargets.Count() );
   937     for ( TInt i = 0; i < operationTargets.Count(); i++ )
   918     for ( TInt i = 0; i < operationTargets.Count(); i++ )
   938         {
   919         {
   939         HBufC* videoUri = iVideoModel->GetVideoUri( operationTargets[i] ).AllocLC();
   920         HBufC* videoUri = iVideoModel->GetVideoUri( operationTargets[i] ).AllocLC();
   940         TInt64 videoSize = iVideoModel->GetVideoSize( operationTargets[i] );
   921         TInt64 videoSize = iVideoModel->GetVideoSize( operationTargets[i] );
   941         TVcxMyVideosDownloadState dlState = iVideoModel->VideoDownloadState( operationTargets[i] );
       
   942 
   922 
   943         IPTVLOGSTRING3_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::HandleSendL() file: %S (%ld bytes)", videoUri, videoSize );
   923         IPTVLOGSTRING3_LOW_LEVEL( "CVcxHgMyVideosVideoListImpl::HandleSendL() file: %S (%ld bytes)", videoUri, videoSize );
   944 
   924 
   945         // Attach file to message
   925         // Attach file to message
   946         if ( videoUri->Length() > 0 &&
   926         if ( videoUri->Length() > 0 && videoSize > 0 )
   947                 videoSize > 0 &&
       
   948                 EVcxMyVideosDlStateNone == dlState )
       
   949             {
   927             {
   950             message->AppendAttachmentL( *videoUri );
   928             message->AppendAttachmentL( *videoUri );
   951             attachmentsTotalSize += videoSize;
   929             attachmentsTotalSize += videoSize;
   952             }
   930             }
   953 
   931