726 |
729 |
727 void CPodcastShowsView::UpdateToolbar(TBool aVisible) |
730 void CPodcastShowsView::UpdateToolbar(TBool aVisible) |
728 { |
731 { |
729 CAknToolbar* toolbar = Toolbar(); |
732 CAknToolbar* toolbar = Toolbar(); |
730 |
733 |
731 if (!toolbar) { |
734 if (toolbar) { |
732 return; |
735 if (iListContainer->IsVisible()) { |
733 } |
736 toolbar->SetToolbarVisibility(aVisible); |
734 |
737 } |
735 if (iListContainer->IsVisible()) { |
738 |
736 toolbar->SetToolbarVisibility(aVisible); |
739 TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && |
737 } |
740 iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
738 |
741 |
739 RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
742 toolbar->HideItem(EPodcastUpdateFeed, updatingState, ETrue ); |
740 TInt itemCnt = fItems.Count(); |
743 toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !updatingState, ETrue ); |
741 |
744 |
742 TBool hideDownloadShowCmd = EFalse; |
745 #ifdef SYMBIAN1_UI |
743 TBool dimDownloadShowCmd = EFalse; |
746 RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
744 TBool hideSetPlayed = EFalse; |
747 TInt itemCnt = fItems.Count(); |
745 TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && |
748 |
746 iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
749 TBool hideDownloadShowCmd = EFalse; |
747 |
750 TBool dimDownloadShowCmd = EFalse; |
748 if(iListContainer->Listbox() != NULL) |
751 TBool hideSetPlayed = EFalse; |
749 { |
752 |
750 TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
753 if(iListContainer->Listbox() != NULL) |
751 |
754 { |
752 if(index>= 0 && index < itemCnt) |
755 TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
753 { |
756 |
754 switch(fItems[index]->DownloadState()) |
757 if(index>= 0 && index < itemCnt) |
755 { |
758 { |
756 case ENotDownloaded: |
759 switch(fItems[index]->DownloadState()) |
757 case EFailedDownload: |
760 { |
758 hideDownloadShowCmd = EFalse; |
761 case ENotDownloaded: |
759 dimDownloadShowCmd = EFalse; |
762 case EFailedDownload: |
760 break; |
763 hideDownloadShowCmd = EFalse; |
761 case EQueued: |
764 dimDownloadShowCmd = EFalse; |
762 case EDownloading: |
765 break; |
763 hideDownloadShowCmd = EFalse; |
766 case EQueued: |
764 dimDownloadShowCmd = ETrue; |
767 case EDownloading: |
765 break; |
768 hideDownloadShowCmd = EFalse; |
766 case EDownloaded: |
769 dimDownloadShowCmd = ETrue; |
767 hideDownloadShowCmd = ETrue; |
770 break; |
768 break; |
771 case EDownloaded: |
769 } |
772 hideDownloadShowCmd = ETrue; |
770 |
773 break; |
771 if(fItems[index]->PlayState() == EPlayed) { |
774 } |
772 hideSetPlayed = ETrue; |
775 |
773 } |
776 if(fItems[index]->PlayState() == EPlayed) { |
774 } |
777 hideSetPlayed = ETrue; |
775 } |
778 } |
776 |
779 } |
777 toolbar->HideItem(EPodcastUpdateFeed, updatingState, ETrue ); |
780 } |
778 toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !updatingState, ETrue ); |
781 |
779 |
782 if (hideDownloadShowCmd) { |
780 if (hideDownloadShowCmd) { |
783 toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue ); |
781 toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue ); |
784 toolbar->HideItem(EPodcastDeleteShow, EFalse, ETrue); |
782 toolbar->HideItem(EPodcastDeleteShow, EFalse, ETrue); |
785 toolbar->SetItemDimmed(EPodcastDeleteShow, updatingState, ETrue); |
783 toolbar->SetItemDimmed(EPodcastDeleteShow, updatingState, ETrue); |
786 } else { |
784 } else { |
787 toolbar->HideItem(EPodcastDownloadShow, EFalse, ETrue ); |
785 toolbar->HideItem(EPodcastDownloadShow, EFalse, ETrue ); |
788 toolbar->HideItem(EPodcastDeleteShow, ETrue, ETrue); |
786 toolbar->HideItem(EPodcastDeleteShow, ETrue, ETrue); |
789 toolbar->SetItemDimmed(EPodcastDownloadShow, updatingState || dimDownloadShowCmd, ETrue); |
787 toolbar->SetItemDimmed(EPodcastDownloadShow, updatingState || dimDownloadShowCmd, ETrue); |
790 } |
788 } |
791 |
789 |
792 if (hideSetPlayed) { |
790 if (hideSetPlayed) { |
793 toolbar->HideItem(EPodcastMarkAsPlayed, ETrue, ETrue ); |
791 toolbar->HideItem(EPodcastMarkAsPlayed, ETrue, ETrue ); |
794 toolbar->HideItem(EPodcastMarkAsUnplayed, EFalse, ETrue ); |
792 toolbar->HideItem(EPodcastMarkAsUnplayed, EFalse, ETrue ); |
795 toolbar->SetItemDimmed(EPodcastMarkAsUnplayed, updatingState, ETrue); |
793 toolbar->SetItemDimmed(EPodcastMarkAsUnplayed, updatingState, ETrue); |
796 } else { |
794 } else { |
797 toolbar->HideItem(EPodcastMarkAsPlayed, EFalse, ETrue ); |
795 toolbar->HideItem(EPodcastMarkAsPlayed, EFalse, ETrue ); |
798 toolbar->HideItem(EPodcastMarkAsUnplayed, ETrue, ETrue ); |
796 toolbar->HideItem(EPodcastMarkAsUnplayed, ETrue, ETrue ); |
799 toolbar->SetItemDimmed(EPodcastMarkAsPlayed, updatingState, ETrue); |
797 toolbar->SetItemDimmed(EPodcastMarkAsPlayed, updatingState, ETrue); |
800 } |
|
801 #endif |
798 } |
802 } |
799 } |
803 } |
800 |
804 |
801 void CPodcastShowsView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */) |
805 void CPodcastShowsView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */) |
802 { |
806 { |