application/src/PodcastShowsView.cpp
changeset 66 41d00e97e2f7
parent 63 a8538f50e2ba
child 74 af6475fdf8d6
--- a/application/src/PodcastShowsView.cpp	Thu Apr 01 11:39:23 2010 +0200
+++ b/application/src/PodcastShowsView.cpp	Thu Apr 01 11:41:33 2010 +0200
@@ -203,12 +203,11 @@
 		TUid aCustomMessageId, const TDesC8& aCustomMessage)
 	{
 	DP("CPodcastShowsView::DoActivateL BEGIN");
+	CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage);
+	
+	iPreviousView = TVwsViewId(KUidPodcast, KUidPodcastFeedViewID);
 	
 	UpdateViewTitleL();
-	
-	CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage);
-	iPreviousView = TVwsViewId(KUidPodcast, KUidPodcastFeedViewID);
-	
 	UpdateFeedUpdateStateL();
 	UpdateToolbar();
 	DP("CPodcastShowsView::DoActivateL END");
@@ -216,12 +215,6 @@
 
 void CPodcastShowsView::DoDeactivate()
 	{
-	CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
-		     ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-	
-//	titlePane->SetSmallPicture(NULL, NULL, ETrue);
-	titlePane->SetPicture(NULL, NULL);
-	titlePane->SetTextToDefaultL();
 	CPodcastListView::DoDeactivate();
 	}
 
@@ -269,7 +262,7 @@
 			{
 			TBuf<KMaxMessageLength> message;
 			iEikonEnv->ReadResourceL(message, R_PODCAST_CONNECTION_ERROR);
-			ShowErrorMessage(message);
+			ShowErrorMessageL(message);
 			}
 			break;
 		default:
@@ -563,17 +556,17 @@
 	switch (aCommand)
 		{
 		case EPodcastMarkAsPlayed:
-			HandleSetShowPlayed(ETrue);
+			HandleSetShowPlayedL(ETrue);
 			break;
 		case EPodcastMarkAsUnplayed:
-			HandleSetShowPlayed(EFalse);
+			HandleSetShowPlayedL(EFalse);
 			break;
 		case EPodcastMarkAllPlayed:
-			iPodcastModel.MarkSelectionPlayed();
+			iPodcastModel.MarkSelectionPlayedL();
 			UpdateListboxItemsL();
 			break;
 		case EPodcastDeleteShow:
-			HandleDeleteShow();
+			HandleDeleteShowL();
 			break;
 		case EPodcastDownloadShow:
 			{
@@ -614,7 +607,7 @@
 			CPodcastListView::HandleCommandL(aCommand);
 			break;
 		}
-	iListContainer->SetLongTapDetected(EFalse);
+	iListContainer->SetLongTapDetectedL(EFalse);
 
 	UpdateToolbar();
 	}
@@ -628,30 +621,6 @@
 		}
 }
 	
-void CPodcastShowsView::ImageOperationCompleteL(TInt aError, TUint /*aHandle*/, CPodcastModel& /*aPodcastModel*/)
-	{
-	iLastImageHandlerError = aError;
-	if(iSetTitlebarImage)
-		{
-		iSetTitlebarImage = EFalse;
-		if(aError == KErrNone)
-			{
-			CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
-						 ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
-			titlePane->SetSmallPicture(iPodcastModel.ImageHandler().ScaledBitmap(), NULL, ETrue);
-			}
-		else
-			{
-			iPodcastModel.ImageHandler().ScaledBitmap();
-			}
-			
-		}
-	else
-		{
-		CActiveScheduler::Stop();
-		}
-	}
-	
 void CPodcastShowsView::DisplayShowInfoDialogL()
 	{
 	TInt index = iListContainer->Listbox()->CurrentItemIndex();
@@ -683,8 +652,12 @@
 	
 		toolbar->HideItem(EPodcastUpdateFeed, updatingState, ETrue ); 
 		toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !updatingState, ETrue );
-
-#ifdef SYMBIAN1_UI
+#ifndef SYMBIAN1_UI
+		// there seems to be drawing bugs in the toolbar if there is only
+		// one or two buttons defined in the resource, so we have download
+		// there but always hidden
+		toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue );
+#else SYMBIAN1_UI
 		RShowInfoArray &fItems = iPodcastModel.ActiveShowList();
 		TInt itemCnt = fItems.Count();
 	
@@ -748,7 +721,7 @@
 {
 	DP("CPodcastShowsView::HandleLongTapEventL BEGIN");
 
-	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(
@@ -777,7 +750,7 @@
 	DP("CPodcastShowsView::HandleLongTapEventL END");
 }
 
-void CPodcastShowsView::HandleSetShowPlayed(TBool aPlayed)
+void CPodcastShowsView::HandleSetShowPlayedL(TBool aPlayed)
 	{
 
 	TInt index = iListContainer->Listbox()->CurrentItemIndex();
@@ -786,13 +759,13 @@
 		{
 		CShowInfo *info = iPodcastModel.ActiveShowList()[index];
 		info->SetPlayState(aPlayed ? EPlayed : ENeverPlayed);
-		iPodcastModel.ShowEngine().UpdateShow(*info);
+		iPodcastModel.ShowEngine().UpdateShowL(*info);
 		UpdateShowItemDataL(iPodcastModel.ActiveShowList()[index], index, 0);
 		iListContainer->Listbox()->DrawItem(index);					
 		}
 	}
 
-void CPodcastShowsView::HandleDeleteShow()
+void CPodcastShowsView::HandleDeleteShowL()
 	{
 	TInt index = iListContainer->Listbox()->CurrentItemIndex();
 
@@ -803,7 +776,7 @@
 		TBuf<KMaxMessageLength> templ;
 		iEikonEnv->ReadResourceL(templ, R_PODCAST_DELETE_SHOW_PROMPT);
 		msg.Format(templ, &(info->Title()));
-		if (ShowQueryMessage(msg))
+		if (ShowQueryMessageL(msg))
 			{
 			iPodcastModel.ShowEngine().DeleteShowL(iPodcastModel.ActiveShowList()[index]->Uid());
 			
@@ -811,7 +784,7 @@
 			
 			info->SetDownloadState(ENotDownloaded);
 			info->SetPlayState(EPlayed);
-			iPodcastModel.ShowEngine().UpdateShow(*info);
+			iPodcastModel.ShowEngine().UpdateShowL(*info);
 			
 			UpdateShowItemDataL(iPodcastModel.ActiveShowList()[index], index, 0);
 			iListContainer->Listbox()->DrawItem(index);					
@@ -821,7 +794,7 @@
 
 void CPodcastShowsView::DownloadQueueUpdatedL(TInt aDownloadingShows, TInt aQueuedShows)
 	{
-	((CPodcastAppUi*)AppUi())->UpdateQueueTab(aDownloadingShows+aQueuedShows);
+	((CPodcastAppUi*)AppUi())->UpdateQueueTabL(aDownloadingShows+aQueuedShows);
 	UpdateListboxItemsL();
 	}
 
@@ -855,7 +828,6 @@
 			}
 		else
 			{
-			titlePane->SetPicture(NULL, NULL);
 			titlePane->SetTextToDefaultL();
 			}