application/src/PodcastFeedView.cpp
branchRCL_3
changeset 328 75a70f4a4f6d
parent 323 0bd524909716
child 341 a648d7ca5e27
--- a/application/src/PodcastFeedView.cpp	Mon Nov 01 14:12:51 2010 +0000
+++ b/application/src/PodcastFeedView.cpp	Mon Nov 01 22:59:47 2010 +0000
@@ -33,6 +33,7 @@
 #include <pathinfo.h> 
 #include <akncommondialogsdynmem.h> 
 #include "Podcatcher.pan"
+#include <aknmessagequerydialog.h>
 
 const TInt KMaxFeedNameLength = 100;
 const TInt KMaxUnplayedFeedsLength =64;
@@ -235,6 +236,7 @@
 			TInt index = iListContainer->Listbox()->CurrentItemIndex();
 			sortedItems = &iPodcastModel.FeedEngine().GetSortedFeeds();
 
+			DP1("Desc: %S",&((*sortedItems)[index]->Description().Left(30)));
 			if(index >= 0 && index < sortedItems->Count())
 				{
 				iPodcastModel.SetActiveFeedInfo((*sortedItems)[index]);			
@@ -558,6 +560,9 @@
 				iPodcastModel.FeedEngine().CancelUpdateAllFeeds();
 				}
 			}break;
+		case EPodcastShowInfo:
+			DisplayFeedInfoDialogL();
+			break;
 		default:
 			CPodcastListView::HandleCommandL(aCommand);
 			break;
@@ -567,6 +572,40 @@
 	DP("CPodcastFeedView::HandleCommandL END");
 	}
 
+void CPodcastFeedView::DisplayFeedInfoDialogL()
+	{
+	const RFeedInfoArray* sortedItems = NULL;
+	TInt index = iListContainer->Listbox()->CurrentItemIndex();
+	sortedItems = &iPodcastModel.FeedEngine().GetSortedFeeds();
+
+	if(index >= 0 && index < sortedItems->Count())
+		{
+		CFeedInfo *info = (*sortedItems)[index];
+		HBufC* description = info->Description().AllocL();
+		HBufC* title = info->Title().AllocL();
+		CAknMessageQueryDialog* note = new ( ELeave ) CAknMessageQueryDialog( description, title );
+							
+		note->PrepareLC( R_SHOW_INFO_NOTE ); // Adds to CleanupStack
+		note->RunLD();
+		}
+	}
+
+void CPodcastFeedView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
+{
+	if(aResourceId == R_PODCAST_FEEDVIEW_MENU)
+		{
+		const RFeedInfoArray* sortedItems = NULL;
+		TInt index = iListContainer->Listbox()->CurrentItemIndex();
+		sortedItems = &iPodcastModel.FeedEngine().GetSortedFeeds();
+
+		if(index >= 0 && index < sortedItems->Count())
+			{
+			CFeedInfo *info = (*sortedItems)[index];
+			aMenuPane->SetItemDimmed(EPodcastShowInfo, !info->Description().Length());
+			}
+		}
+}
+
 void CPodcastFeedView::UpdateToolbar(TBool aVisible)
 {
 	DP("CPodcastFeedView::UpdateToolbar BEGIN");