application/src/PodcastFeedView.cpp
changeset 66 41d00e97e2f7
parent 63 a8538f50e2ba
child 69 04c6ccce8e7e
--- a/application/src/PodcastFeedView.cpp	Thu Apr 01 11:39:23 2010 +0200
+++ b/application/src/PodcastFeedView.cpp	Thu Apr 01 11:41:33 2010 +0200
@@ -175,27 +175,19 @@
 	                                  const TDesC8& aCustomMessage)
 	{
 	CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage);
-
+	
 	if (aPrevViewId.iViewUid == KUidPodcastShowsViewID)
 		{
 		// back key from shows view
 		iViewingShows = EFalse;
 		}
 	
-	if (iViewingShows)
-		{
-		// go to shows view
-		AppUi()->ActivateLocalViewL(KUidPodcastShowsViewID,  TUid::Uid(0), KNullDesC8());
-		} 
-	else 
-		{
 		UpdateListboxItemsL();		
 		UpdateToolbar();
 
-		if (iFirstActivateAfterLaunch)
-			{
-			iFirstActivateAfterLaunch = EFalse;
-			}
+	if (iFirstActivateAfterLaunch)
+		{
+		iFirstActivateAfterLaunch = EFalse;
 		}
 	}
 
@@ -216,11 +208,9 @@
 			DP("PEN DOWN");
 			break;
 			
-//#ifndef SYMBIAN1_UI
+#ifndef SYMBIAN1_UI
 	case EEventItemClicked:
-		DP("SINGLE TAP");
-		break;
-//#endif
+#endif
 	case EEventEnterKeyPressed:
 	case EEventItemDoubleClicked:
 	case EEventItemActioned:
@@ -269,7 +259,7 @@
 				{
 				TBuf<KMaxMessageLength> message;
 				iEikonEnv->ReadResourceL(message, R_PODCAST_CONNECTION_ERROR);
-				ShowErrorMessage(message);
+				ShowErrorMessageL(message);
 				}
 			}
 			break;
@@ -545,7 +535,7 @@
 				{
 				TBuf<KMaxMessageLength> message;
 				iEikonEnv->ReadResourceL(message, R_EXIT_SHOWS_DOWNLOADING);
-				if(ShowQueryMessage(message))
+				if(ShowQueryMessageL(message))
 					{
 					// pass it on to AppUi, which will exit for us
 					CPodcastListView::HandleCommandL(aCommand);
@@ -563,7 +553,7 @@
 			break;
 		}
 	
-	iListContainer->SetLongTapDetected(EFalse); // in case we got here by long tapping
+	iListContainer->SetLongTapDetectedL(EFalse); // in case we got here by long tapping
 	UpdateToolbar();
 	}
 
@@ -624,7 +614,7 @@
 				// ask if users wants to update it now
 				TBuf<KMaxMessageLength> message;
 				iEikonEnv->ReadResourceL(message, R_ADD_FEED_SUCCESS);
-				if(ShowQueryMessage(message))
+				if(ShowQueryMessageL(message))
 					{
 					CFeedInfo *info = iPodcastModel.FeedEngine().GetFeedInfoByUid(newFeedInfo->Uid());
 					
@@ -638,7 +628,7 @@
 				{
 				TBuf<KMaxMessageLength> message;
 				iEikonEnv->ReadResourceL(message, R_ADD_FEED_EXISTS);
-				ShowErrorMessage(message);
+				ShowErrorMessageL(message);
 				}		
 			
 			CleanupStack::PopAndDestroy(newFeedInfo);
@@ -669,7 +659,7 @@
 				iEikonEnv->ReadResourceL(dlgMessage, R_ADD_FEED_REPLACE);
 
 				// Ask the user if it is OK to remove all shows
-				if ( ShowQueryMessage(dlgMessage))
+				if ( ShowQueryMessageL(dlgMessage))
 					{
 					PodcastUtils::FixProtocolsL(url);
 					
@@ -696,7 +686,7 @@
 						// the feed existed. Object deleted in AddFeed.	
 						TBuf<KMaxMessageLength> dlgMessage;
 						iEikonEnv->ReadResourceL(dlgMessage, R_ADD_FEED_EXISTS);
-						ShowErrorMessage(dlgMessage);
+						ShowErrorMessageL(dlgMessage);
 					}
 					CleanupStack::PopAndDestroy(temp);
 				}
@@ -706,7 +696,7 @@
 				{
 					info->SetTitleL(title);
 					info->SetCustomTitle();	
-					iPodcastModel.FeedEngine().UpdateFeed(info);
+					iPodcastModel.FeedEngine().UpdateFeedL(info);
 					UpdateListboxItemsL();
 				}
 			}
@@ -727,7 +717,7 @@
 			TBuf<KMaxMessageLength> message;
 			iEikonEnv->ReadResourceL(templ, R_PODCAST_REMOVE_FEED_PROMPT);
 			message.Format(templ, &info->Title());					
-			if(ShowQueryMessage(message))
+			if(ShowQueryMessageL(message))
 				{
 				iPodcastModel.FeedEngine().RemoveFeedL(iItemIdArray[index]);
 				iItemArray->Delete(index);
@@ -791,7 +781,7 @@
 				if (err != KErrNone) {
 					TBuf<KMaxMessageLength> message;
 					iEikonEnv->ReadResourceL(message, R_IMPORT_FEED_FAILURE);
-					ShowErrorMessage(message);
+					ShowErrorMessageL(message);
 					}
 				}
 				
@@ -847,13 +837,13 @@
 					TBuf<KMaxMessageLength> templ;
 					iEikonEnv->ReadResourceL(templ, R_EXPORT_FEED_SUCCESS);
 					message.Format(templ, numFeeds);
-					ShowOkMessage(message);
+					ShowOkMessageL(message);
 					} 
 				else 
 					{
 					TBuf<KMaxMessageLength> message;
 					iEikonEnv->ReadResourceL(message, R_EXPORT_FEED_FAILURE);
-					ShowErrorMessage(message);
+					ShowErrorMessageL(message);
 					}
 				}
 			CleanupStack::PopAndDestroy(fileDlg);
@@ -863,7 +853,7 @@
 	CleanupStack::PopAndDestroy(memDlg);									
 	}
 
-void CPodcastFeedView::CheckResumeDownload()
+void CPodcastFeedView::CheckResumeDownloadL()
 	{
 	// if there are shows queued for downloading, ask if we should resume now
 	RShowInfoArray showsDownloading;
@@ -874,7 +864,7 @@
 		TBuf<KMaxMessageLength> msg;
 		iEikonEnv->ReadResourceL(msg, R_PODCAST_ENABLE_DOWNLOADS_PROMPT);
 	
-		if (ShowQueryMessage(msg))
+		if (ShowQueryMessageL(msg))
 			{
 			// need to suspend downloads before ResumeDownloadL will work :)
 			iPodcastModel.SettingsEngine().SetDownloadSuspended(ETrue);
@@ -902,7 +892,7 @@
 			{
 			TBuf<KMaxMessageLength> message;
 			iEikonEnv->ReadResourceL(message, R_PODCAST_CONNECTION_ERROR);
-			ShowErrorMessage(message);
+			ShowErrorMessageL(message);
 			}
 			break;
 		case KErrNone: 
@@ -922,7 +912,7 @@
 				iEikonEnv->ReadResourceL(templ, R_IMPORT_FEED_SUCCESS);
 				message.Format(templ, aNumFeedsImported);
 				
-				if(ShowQueryMessage(message))
+				if(ShowQueryMessageL(message))
 					{
 					HandleCommandL(EPodcastUpdateAllFeeds);
 					}
@@ -930,11 +920,12 @@
 				break;
 			case EOpmlSearching:
 				delete iWaitDialog;
+				iWaitDialog = NULL;
 				if (iPodcastModel.FeedEngine().GetSearchResults().Count() == 0)
 					{
 					TBuf<KMaxMessageLength> message;
 					iEikonEnv->ReadResourceL(message, R_SEARCH_NORESULTS);
-					ShowErrorMessage(message);
+					ShowErrorMessageL(message);
 					}
 				else
 					{
@@ -968,7 +959,7 @@
 		return; // we don't allow feed manipulation while update is running
 	}
 
-	iListContainer->SetLongTapDetected(ETrue);
+	iListContainer->SetLongTapDetectedL(ETrue);
 
 	const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1
 	TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems(
@@ -981,3 +972,8 @@
     }
 	DP("CPodcastListView::HandleLongTapEventL END");
 }
+
+TBool CPodcastFeedView::ViewingShows()
+	{
+	return iViewingShows;
+	}