application/src/PodcastShowsView.cpp
changeset 93 c2f1ea38ec70
parent 88 1cc7501102a8
child 98 5f9e7e14eb11
equal deleted inserted replaced
92:70749e2f572d 93:c2f1ea38ec70
    36 
    36 
    37 _LIT(KSizeDownloadingOf, "%.1f/%.1f MB");
    37 _LIT(KSizeDownloadingOf, "%.1f/%.1f MB");
    38 _LIT(KShowsSizeFormatS60, "%.1f MB");
    38 _LIT(KShowsSizeFormatS60, "%.1f MB");
    39 
    39 
    40 _LIT(KShowFormat, "%d\t%S\t%S%S\t");
    40 _LIT(KShowFormat, "%d\t%S\t%S%S\t");
    41 _LIT(KShowErrorFormat, "%d\t%S\t%S\t");
    41 //_LIT(KShowErrorFormat, "%d\t%S\t%S\t");
    42 _LIT(KShowQueueFormat, "%d\t%S\t%S%S\t");
    42 //_LIT(KShowQueueFormat, "%d\t%S\t%S%S\t");
    43 
    43 
    44 // these must correspond with TShowsIconIndex
    44 // these must correspond with TShowsIconIndex
    45 
    45 
    46 const TUint KShowIconArrayIds[] =
    46 const TUint KShowIconArrayIds[] =
    47 	{
    47 	{
   313 void CPodcastShowsView::HandleListBoxEventL(CEikListBox* /*aListBox*/,
   313 void CPodcastShowsView::HandleListBoxEventL(CEikListBox* /*aListBox*/,
   314 		TListBoxEvent aEventType)
   314 		TListBoxEvent aEventType)
   315 	{
   315 	{
   316 	switch (aEventType)
   316 	switch (aEventType)
   317 		{
   317 		{
   318 #ifndef SYMBIAN1_UI
       
   319 		case EEventItemClicked:
   318 		case EEventItemClicked:
   320 #endif
       
   321 		case EEventEnterKeyPressed:		
   319 		case EEventEnterKeyPressed:		
   322 		case EEventItemActioned:
   320 		case EEventItemActioned:
   323 		case EEventItemDoubleClicked:
   321 		case EEventItemDoubleClicked:
   324 			{
   322 			{
   325 			RShowInfoArray &fItems = iPodcastModel.ActiveShowList();
   323 			RShowInfoArray &fItems = iPodcastModel.ActiveShowList();
   668 		TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && 
   666 		TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && 
   669 				iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid();
   667 				iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid();
   670 	
   668 	
   671 		toolbar->HideItem(EPodcastUpdateFeed, updatingState, ETrue ); 
   669 		toolbar->HideItem(EPodcastUpdateFeed, updatingState, ETrue ); 
   672 		toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !updatingState, ETrue );
   670 		toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !updatingState, ETrue );
   673 #ifndef SYMBIAN1_UI
       
   674 		// there seems to be drawing bugs in the toolbar if there is only
   671 		// there seems to be drawing bugs in the toolbar if there is only
   675 		// one or two buttons defined in the resource, so we have download
   672 		// one or two buttons defined in the resource, so we have download
   676 		// there but always hidden
   673 		// there but always hidden
   677 		toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue );
   674 		toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue );
   678 #else SYMBIAN1_UI
       
   679 		RShowInfoArray &fItems = iPodcastModel.ActiveShowList();
       
   680 		TInt itemCnt = fItems.Count();
       
   681 	
       
   682 		TBool hideDownloadShowCmd = EFalse;
       
   683 		TBool dimDownloadShowCmd = EFalse;
       
   684 		TBool hideSetPlayed = EFalse;
       
   685 	
       
   686 		if(iListContainer->Listbox() != NULL)
       
   687 		{
       
   688 			TInt index = iListContainer->Listbox()->CurrentItemIndex();
       
   689 			
       
   690 			if(index>= 0 && index < itemCnt)
       
   691 			{
       
   692 				switch(fItems[index]->DownloadState())
       
   693 					{
       
   694 					case ENotDownloaded:
       
   695 					case EFailedDownload:
       
   696 						hideDownloadShowCmd = EFalse;
       
   697 						dimDownloadShowCmd = EFalse;
       
   698 						break;
       
   699 					case EQueued:
       
   700 					case EDownloading:
       
   701 						hideDownloadShowCmd = EFalse;
       
   702 						dimDownloadShowCmd = ETrue;
       
   703 						break;
       
   704 					case EDownloaded:
       
   705 						hideDownloadShowCmd = ETrue;
       
   706 						break;
       
   707 					}
       
   708 					
       
   709 				if(fItems[index]->PlayState() == EPlayed) {
       
   710 					hideSetPlayed = ETrue;
       
   711 				}
       
   712 			}
       
   713 		}
       
   714 		
       
   715 		if (hideDownloadShowCmd) {
       
   716 			toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue );
       
   717 			toolbar->HideItem(EPodcastDeleteShow, EFalse, ETrue);
       
   718 			toolbar->SetItemDimmed(EPodcastDeleteShow, updatingState, ETrue);
       
   719 		} else {
       
   720 			toolbar->HideItem(EPodcastDownloadShow, EFalse, ETrue );
       
   721 			toolbar->HideItem(EPodcastDeleteShow, ETrue, ETrue);
       
   722 			toolbar->SetItemDimmed(EPodcastDownloadShow, updatingState || dimDownloadShowCmd, ETrue);	
       
   723 		}
       
   724 		
       
   725 		if (hideSetPlayed) {
       
   726 			toolbar->HideItem(EPodcastMarkAsPlayed, ETrue, ETrue );
       
   727 			toolbar->HideItem(EPodcastMarkAsUnplayed, EFalse, ETrue );
       
   728 			toolbar->SetItemDimmed(EPodcastMarkAsUnplayed, updatingState, ETrue);
       
   729 		} else {
       
   730 			toolbar->HideItem(EPodcastMarkAsPlayed, EFalse, ETrue );
       
   731 			toolbar->HideItem(EPodcastMarkAsUnplayed, ETrue, ETrue );
       
   732 			toolbar->SetItemDimmed(EPodcastMarkAsPlayed, updatingState, ETrue);
       
   733 		}
       
   734 #endif
       
   735 	}
   675 	}
   736 }
   676 }
   737 
   677 
   738 void CPodcastShowsView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */)
   678 void CPodcastShowsView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */)
   739 {
   679 {