103 { |
103 { |
104 } |
104 } |
105 |
105 |
106 void CPodcastShowsView::ConstructL() |
106 void CPodcastShowsView::ConstructL() |
107 { |
107 { |
|
108 DP("CPodcastShowsView::ConstructL BEGIN"); |
108 BaseConstructL(R_PODCAST_SHOWSVIEW); |
109 BaseConstructL(R_PODCAST_SHOWSVIEW); |
109 CPodcastListView::ConstructL(); |
110 CPodcastListView::ConstructL(); |
110 |
111 |
111 CreateIconsL(); |
112 CreateIconsL(); |
112 |
113 |
113 iListContainer->Listbox()->SetListBoxObserver(this); |
114 iListContainer->Listbox()->SetListBoxObserver(this); |
114 |
115 |
115 iPodcastModel.FeedEngine().AddObserver(this); |
116 iPodcastModel.FeedEngine().AddObserver(this); |
116 iPodcastModel.ShowEngine().AddObserver(this); |
117 iPodcastModel.ShowEngine().AddObserver(this); |
117 |
118 |
118 CleanupStack::PopAndDestroy(); |
119 DP("CPodcastShowsView::ConstructL END"); |
119 } |
120 } |
120 |
121 |
121 void CPodcastShowsView::CreateIconsL() |
122 void CPodcastShowsView::CreateIconsL() |
122 { |
123 { |
123 CArrayPtr< CGulIcon>* icons = new(ELeave) CArrayPtrFlat< CGulIcon>(1); |
124 CArrayPtr< CGulIcon>* icons = new(ELeave) CArrayPtrFlat< CGulIcon>(1); |
634 } |
633 } |
635 } |
634 } |
636 |
635 |
637 void CPodcastShowsView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) |
636 void CPodcastShowsView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) |
638 { |
637 { |
|
638 TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && iPodcastModel.ActiveFeedInfo() && |
|
639 iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
|
640 |
639 if(aResourceId == R_PODCAST_SHOWSVIEW_MENU) |
641 if(aResourceId == R_PODCAST_SHOWSVIEW_MENU) |
640 { |
642 { |
641 TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
643 aMenuPane->SetItemDimmed(EPodcastMarkAllPlayed, updatingState || iPodcastModel.ActiveShowList().Count() == 0); |
642 aMenuPane->SetItemDimmed(EPodcastMarkAllPlayed, updatingState); |
644 aMenuPane->SetItemDimmed(EPodcastUpdateFeed, updatingState); |
|
645 aMenuPane->SetItemDimmed(EPodcastCancelUpdateAllFeeds, !updatingState); |
|
646 aMenuPane->SetItemDimmed(EPodcastShowsShowMenu, updatingState || iPodcastModel.ActiveShowList().Count() == 0); |
|
647 } |
|
648 else if (aResourceId == R_SHOWS_SHOW_MENU) |
|
649 { |
|
650 TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
651 if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
652 { |
|
653 CShowInfo *info = iPodcastModel.ActiveShowList()[index]; |
|
654 TBool hideDeleteShowCmd = info->DownloadState() != EDownloaded; |
|
655 TBool hideMarkOld = info->PlayState() == EPlayed; |
|
656 |
|
657 aMenuPane->SetItemDimmed(EPodcastMarkAsPlayed, hideMarkOld); |
|
658 aMenuPane->SetItemDimmed(EPodcastMarkAsUnplayed, !hideMarkOld); |
|
659 aMenuPane->SetItemDimmed(EPodcastDeleteShow, hideDeleteShowCmd); |
|
660 } |
643 } |
661 } |
644 } |
662 } |
645 |
663 |
646 void CPodcastShowsView::DisplayShowInfoDialogL() |
664 void CPodcastShowsView::DisplayShowInfoDialogL() |
647 { |
665 { |