215 DP("CPodcastShowsView::DoActivateL BEGIN"); |
215 DP("CPodcastShowsView::DoActivateL BEGIN"); |
216 CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); |
216 CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); |
217 |
217 |
218 iPreviousView = TVwsViewId(KUidPodcast, KUidPodcastFeedViewID); |
218 iPreviousView = TVwsViewId(KUidPodcast, KUidPodcastFeedViewID); |
219 |
219 |
|
220 iShowNewShows = (aCustomMessageId.iUid == 1); |
|
221 |
|
222 if (iShowNewShows) |
|
223 { |
|
224 CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
|
225 cba->SetCommandSetL(R_PODCAST_CBA); |
|
226 cba->DrawDeferred(); |
|
227 } |
|
228 else |
|
229 { |
|
230 CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
|
231 cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_BACK); |
|
232 cba->DrawDeferred(); |
|
233 } |
|
234 |
220 UpdateViewTitleL(); |
235 UpdateViewTitleL(); |
221 UpdateFeedUpdateStateL(); |
236 UpdateFeedUpdateStateL(); |
222 DP("CPodcastShowsView::DoActivateL END"); |
237 DP("CPodcastShowsView::DoActivateL END"); |
223 } |
238 } |
224 |
239 |
507 if (iListContainer->IsVisible()) |
522 if (iListContainer->IsVisible()) |
508 { |
523 { |
509 TListItemProperties itemProps; |
524 TListItemProperties itemProps; |
510 TInt len = 0; |
525 TInt len = 0; |
511 |
526 |
512 iPodcastModel.GetShowsByFeedL(iPodcastModel.ActiveFeedInfo()->Uid()); |
527 if (iShowNewShows) |
513 |
528 { |
|
529 iPodcastModel.GetNewShowsL(); |
|
530 } |
|
531 else |
|
532 { |
|
533 iPodcastModel.GetShowsByFeedL(iPodcastModel.ActiveFeedInfo()->Uid()); |
|
534 } |
|
535 |
514 RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
536 RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
515 len = fItems.Count(); |
537 len = fItems.Count(); |
516 |
538 |
517 if (iListContainer->Listbox() != NULL) |
539 if (iListContainer->Listbox() != NULL) |
518 { |
540 { |
586 { |
608 { |
587 switch (aCommand) |
609 switch (aCommand) |
588 { |
610 { |
589 case EPodcastMarkAsPlayed: |
611 case EPodcastMarkAsPlayed: |
590 HandleSetShowPlayedL(ETrue); |
612 HandleSetShowPlayedL(ETrue); |
|
613 if (iShowNewShows) UpdateListboxItemsL(); |
591 break; |
614 break; |
592 case EPodcastMarkAsUnplayed: |
615 case EPodcastMarkAsUnplayed: |
593 HandleSetShowPlayedL(EFalse); |
616 HandleSetShowPlayedL(EFalse); |
|
617 if (iShowNewShows) UpdateListboxItemsL(); |
594 break; |
618 break; |
595 case EPodcastMarkAllPlayed: |
619 case EPodcastMarkAllPlayed: |
596 iPodcastModel.MarkSelectionPlayedL(); |
620 iPodcastModel.MarkSelectionPlayedL(); |
597 UpdateListboxItemsL(); |
621 UpdateListboxItemsL(); |
598 break; |
622 break; |
625 CleanupStack::PopAndDestroy(str); |
649 CleanupStack::PopAndDestroy(str); |
626 } |
650 } |
627 } |
651 } |
628 } |
652 } |
629 break; |
653 break; |
|
654 case EPodcastUpdateAllFeeds: |
|
655 { |
|
656 iPodcastModel.FeedEngine().UpdateAllFeedsL(); |
|
657 UpdateToolbar(); |
|
658 }break; |
630 case EPodcastCancelUpdateAllFeeds: |
659 case EPodcastCancelUpdateAllFeeds: |
631 iPodcastModel.FeedEngine().CancelUpdateAllFeeds(); |
660 iPodcastModel.FeedEngine().CancelUpdateAllFeeds(); |
632 break; |
661 break; |
633 case EPodcastShowInfo: |
662 case EPodcastShowInfo: |
634 { |
663 { |
709 } |
738 } |
710 |
739 |
711 TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && iPodcastModel.ActiveFeedInfo() && |
740 TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && iPodcastModel.ActiveFeedInfo() && |
712 iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
741 iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
713 |
742 |
714 toolbar->HideItem(EPodcastUpdateFeed, updatingState, ETrue ); |
743 if (iShowNewShows) |
|
744 { |
|
745 updatingState = iPodcastModel.FeedEngine().ClientState(); |
|
746 toolbar->HideItem(EPodcastUpdateFeed, ETrue, ETrue ); |
|
747 toolbar->HideItem(EPodcastUpdateAllFeeds, updatingState, ETrue ); |
|
748 } |
|
749 else |
|
750 { |
|
751 toolbar->HideItem(EPodcastUpdateFeed, updatingState, ETrue ); |
|
752 toolbar->HideItem(EPodcastUpdateAllFeeds, ETrue, ETrue ); |
|
753 } |
|
754 |
715 toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !updatingState, ETrue ); |
755 toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !updatingState, ETrue ); |
|
756 |
716 RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
757 RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
717 TInt itemCnt = fItems.Count(); |
758 TInt itemCnt = fItems.Count(); |
718 |
759 |
719 TBool hideDownloadShowCmd = EFalse; |
760 TBool hideDownloadShowCmd = EFalse; |
720 TBool dimDownloadShowCmd = EFalse; |
761 TBool dimDownloadShowCmd = EFalse; |
862 { |
903 { |
863 DP("CPodcastShowsView::UpdateViewTitleL BEGIN"); |
904 DP("CPodcastShowsView::UpdateViewTitleL BEGIN"); |
864 CAknTitlePane* titlePane = static_cast<CAknTitlePane*> |
905 CAknTitlePane* titlePane = static_cast<CAknTitlePane*> |
865 ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); |
906 ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); |
866 |
907 |
867 TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && |
908 TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && iPodcastModel.ActiveFeedInfo() && |
868 iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
909 iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
869 |
910 |
870 if (updatingState) { |
911 if (updatingState) { |
871 SetEmptyTextL(R_PODCAST_EMPTY_LIST_UPDATING); |
912 SetEmptyTextL(R_PODCAST_EMPTY_LIST_UPDATING); |
872 } else { |
913 } else { |
873 SetEmptyTextL(R_PODCAST_EMPTY_LIST); |
914 SetEmptyTextL(R_PODCAST_EMPTY_LIST); |
874 } |
915 } |
875 |
916 |
876 if(iPodcastModel.ActiveFeedInfo()) |
917 if(iShowNewShows) |
|
918 { |
|
919 HBufC *title = iEikonEnv->AllocReadResourceLC(R_NEW_SHOWS); |
|
920 titlePane->SetTextL(*title); |
|
921 CleanupStack::PopAndDestroy(title); |
|
922 } |
|
923 else if(iPodcastModel.ActiveFeedInfo()) |
877 { |
924 { |
878 if (iPodcastModel.ActiveFeedInfo()->Title() != KNullDesC) |
925 if (iPodcastModel.ActiveFeedInfo()->Title() != KNullDesC) |
879 { |
926 { |
880 titlePane->SetTextL( iPodcastModel.ActiveFeedInfo()->Title(), ETrue ); |
927 titlePane->SetTextL( iPodcastModel.ActiveFeedInfo()->Title(), ETrue ); |
881 } |
928 } |