Fix for bug 2060 - added info view for feeds RCL_3
authorSebastian Brannstrom <sebastianb@symbian.org>
Mon, 01 Nov 2010 22:59:47 +0000
branchRCL_3
changeset 328 75a70f4a4f6d
parent 327 b4560769586d
child 330 4cf89a7d3476
Fix for bug 2060 - added info view for feeds
application/data/PodcastFeedView.ra
application/inc/PodcastFeedView.h
application/src/PodcastFeedView.cpp
engine/src/FeedEngine.cpp
--- a/application/data/PodcastFeedView.ra	Mon Nov 01 14:12:51 2010 +0000
+++ b/application/data/PodcastFeedView.ra	Mon Nov 01 22:59:47 2010 +0000
@@ -59,6 +59,12 @@
 			},
 		MENU_ITEM
 			{
+			txt = STRING_r_view_show_info_cmd;
+			command = EPodcastShowInfo;
+			flags = EEikMenuItemSpecific;
+			},
+		MENU_ITEM
+			{
 			txt = STRING_r_view_edit_feed_cmd_short;
 			command = EPodcastEditFeed; 
 			flags = EEikMenuItemSpecific;
--- a/application/inc/PodcastFeedView.h	Mon Nov 01 14:12:51 2010 +0000
+++ b/application/inc/PodcastFeedView.h	Mon Nov 01 22:59:47 2010 +0000
@@ -101,6 +101,7 @@
 
 		// from MImageHandlerCallback
 		void ImageOperationCompleteL(TInt aError, TUint aHandle, CPodcastModel& aPodcastModel);
+		void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
 	private:
 		void FormatFeedInfoListBoxItemL(CFeedInfo& aFeedInfo, TBool aIsUpdating = EFalse);
 		void HandleAddFeedL();
@@ -114,6 +115,7 @@
 		void GetFeedErrorText(TDes &aErrorMessage, TInt aErrorCode);
 		void OpmlParsingCompleteL(TInt aError, TUint aNumFeedsImported);
 		void LoadIcons();
+		void DisplayFeedInfoDialogL();
 	private:
 		CPodcastModel& iPodcastModel;		
 		TUint iFeedUpdating;
--- 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");
--- a/engine/src/FeedEngine.cpp	Mon Nov 01 14:12:51 2010 +0000
+++ b/engine/src/FeedEngine.cpp	Mon Nov 01 22:59:47 2010 +0000
@@ -982,7 +982,7 @@
 			
 			const void *linkz = sqlite3_column_text16(st, 5);
 			TPtrC16 link((const TUint16*)linkz);
-			feedInfo->SetDescriptionL(link);
+			feedInfo->SetLinkL(link);
 					
 			sqlite3_int64 built = sqlite3_column_int64(st, 6);
 			TTime buildtime(built);
@@ -1056,11 +1056,11 @@
 
 			const void *imagefilez = sqlite3_column_text16(st, 4);
 			TPtrC16 imagefile((const TUint16*)imagefilez);
-			feedInfo->SetDescriptionL(imagefile);
+			feedInfo->SetImageFileNameL(imagefile, &iPodcastModel);
 			
 			const void *linkz = sqlite3_column_text16(st, 5);
 			TPtrC16 link((const TUint16*)linkz);
-			feedInfo->SetDescriptionL(link);
+			feedInfo->SetLinkL(link);
 					
 			sqlite3_int64 built = sqlite3_column_int64(st, 6);
 			TTime buildtime(built);