31 #include <aknquerydialog.h> |
31 #include <aknquerydialog.h> |
32 #include <BAUTILS.H> |
32 #include <BAUTILS.H> |
33 #include <pathinfo.h> |
33 #include <pathinfo.h> |
34 #include <akncommondialogsdynmem.h> |
34 #include <akncommondialogsdynmem.h> |
35 #include "Podcatcher.pan" |
35 #include "Podcatcher.pan" |
|
36 #include <aknmessagequerydialog.h> |
36 |
37 |
37 const TInt KMaxFeedNameLength = 100; |
38 const TInt KMaxFeedNameLength = 100; |
38 const TInt KMaxUnplayedFeedsLength =64; |
39 const TInt KMaxUnplayedFeedsLength =64; |
39 const TInt KADayInHours = 24; |
40 const TInt KADayInHours = 24; |
40 #define KMaxMessageLength 200 |
41 #define KMaxMessageLength 200 |
233 { |
234 { |
234 const RFeedInfoArray* sortedItems = NULL; |
235 const RFeedInfoArray* sortedItems = NULL; |
235 TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
236 TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
236 sortedItems = &iPodcastModel.FeedEngine().GetSortedFeeds(); |
237 sortedItems = &iPodcastModel.FeedEngine().GetSortedFeeds(); |
237 |
238 |
|
239 DP1("Desc: %S",&((*sortedItems)[index]->Description().Left(30))); |
238 if(index >= 0 && index < sortedItems->Count()) |
240 if(index >= 0 && index < sortedItems->Count()) |
239 { |
241 { |
240 iPodcastModel.SetActiveFeedInfo((*sortedItems)[index]); |
242 iPodcastModel.SetActiveFeedInfo((*sortedItems)[index]); |
241 iViewingShows = ETrue; |
243 iViewingShows = ETrue; |
242 AppUi()->ActivateLocalViewL(KUidPodcastShowsViewID, TUid::Uid(0), KNullDesC8()); |
244 AppUi()->ActivateLocalViewL(KUidPodcastShowsViewID, TUid::Uid(0), KNullDesC8()); |
556 if(iFeedUpdating) |
558 if(iFeedUpdating) |
557 { |
559 { |
558 iPodcastModel.FeedEngine().CancelUpdateAllFeeds(); |
560 iPodcastModel.FeedEngine().CancelUpdateAllFeeds(); |
559 } |
561 } |
560 }break; |
562 }break; |
|
563 case EPodcastShowInfo: |
|
564 DisplayFeedInfoDialogL(); |
|
565 break; |
561 default: |
566 default: |
562 CPodcastListView::HandleCommandL(aCommand); |
567 CPodcastListView::HandleCommandL(aCommand); |
563 break; |
568 break; |
564 } |
569 } |
565 |
570 |
566 UpdateToolbar(); |
571 UpdateToolbar(); |
567 DP("CPodcastFeedView::HandleCommandL END"); |
572 DP("CPodcastFeedView::HandleCommandL END"); |
568 } |
573 } |
|
574 |
|
575 void CPodcastFeedView::DisplayFeedInfoDialogL() |
|
576 { |
|
577 const RFeedInfoArray* sortedItems = NULL; |
|
578 TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
579 sortedItems = &iPodcastModel.FeedEngine().GetSortedFeeds(); |
|
580 |
|
581 if(index >= 0 && index < sortedItems->Count()) |
|
582 { |
|
583 CFeedInfo *info = (*sortedItems)[index]; |
|
584 HBufC* description = info->Description().AllocL(); |
|
585 HBufC* title = info->Title().AllocL(); |
|
586 CAknMessageQueryDialog* note = new ( ELeave ) CAknMessageQueryDialog( description, title ); |
|
587 |
|
588 note->PrepareLC( R_SHOW_INFO_NOTE ); // Adds to CleanupStack |
|
589 note->RunLD(); |
|
590 } |
|
591 } |
|
592 |
|
593 void CPodcastFeedView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) |
|
594 { |
|
595 if(aResourceId == R_PODCAST_FEEDVIEW_MENU) |
|
596 { |
|
597 const RFeedInfoArray* sortedItems = NULL; |
|
598 TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
599 sortedItems = &iPodcastModel.FeedEngine().GetSortedFeeds(); |
|
600 |
|
601 if(index >= 0 && index < sortedItems->Count()) |
|
602 { |
|
603 CFeedInfo *info = (*sortedItems)[index]; |
|
604 aMenuPane->SetItemDimmed(EPodcastShowInfo, !info->Description().Length()); |
|
605 } |
|
606 } |
|
607 } |
569 |
608 |
570 void CPodcastFeedView::UpdateToolbar(TBool aVisible) |
609 void CPodcastFeedView::UpdateToolbar(TBool aVisible) |
571 { |
610 { |
572 DP("CPodcastFeedView::UpdateToolbar BEGIN"); |
611 DP("CPodcastFeedView::UpdateToolbar BEGIN"); |
573 CAknToolbar* toolbar = Toolbar(); |
612 CAknToolbar* toolbar = Toolbar(); |