Added check and query when downloading is active while trying to exit symbian1
authorSebastian Brannstrom <sebastianb@symbian.org>
Mon, 25 Oct 2010 14:04:32 +0100
branchsymbian1
changeset 289 ba99740139d0
parent 288 757e84a30b9a
child 296 80f1da5ac28b
Added check and query when downloading is active while trying to exit
application/inc/PodcastFeedView.h
application/src/PodcastAppui.cpp
application/src/PodcastFeedView.cpp
--- a/application/inc/PodcastFeedView.h	Mon Oct 25 14:03:39 2010 +0100
+++ b/application/inc/PodcastFeedView.h	Mon Oct 25 14:04:32 2010 +0100
@@ -42,7 +42,9 @@
 		void CheckResumeDownloadL();
 		void UpdateToolbar(TBool aVisible=ETrue);
 		TBool ViewingShows();
-		
+
+ 	   void CheckConfirmExit();
+
 	protected:
 	    void ConstructL();
 		CPodcastFeedView(CPodcastModel& aPodcastModel);
@@ -112,7 +114,7 @@
 		void HandleUpdateFeedL();
 		void GetFeedErrorText(TDes &aErrorMessage, TInt aErrorCode);
 		void OpmlParsingCompleteL(TInt aError, TUint aNumFeedsImported);
-
+		
 	private:
 		CPodcastModel& iPodcastModel;		
 		TBool iUpdatingRunning;
--- a/application/src/PodcastAppui.cpp	Mon Oct 25 14:03:39 2010 +0100
+++ b/application/src/PodcastAppui.cpp	Mon Oct 25 14:04:32 2010 +0100
@@ -123,7 +123,7 @@
         {
         case EAknSoftkeyExit:
             {
-            Exit();
+            iFeedView->CheckConfirmExit();
             break;
             }
         case EEikCmdExit:
--- a/application/src/PodcastFeedView.cpp	Mon Oct 25 14:03:39 2010 +0100
+++ b/application/src/PodcastFeedView.cpp	Mon Oct 25 14:04:32 2010 +0100
@@ -880,6 +880,25 @@
 	showsDownloading.ResetAndDestroy();
 	}
 
+void CPodcastFeedView::CheckConfirmExit()
+	{
+	RShowInfoArray showsDownloading;
+	iPodcastModel.ShowEngine().GetShowsDownloadingL(showsDownloading);
+
+	if (showsDownloading.Count() > 0 && !iPodcastModel.SettingsEngine().DownloadSuspended())
+		{
+		TBuf<256> msg;
+		iEikonEnv->ReadResourceL(msg, R_EXIT_SHOWS_DOWNLOADING);
+		
+		if (!ShowQueryMessageL(msg))
+			{
+			return;
+			}
+		}
+	
+	AppUi()->Exit();
+	}
+
 void CPodcastFeedView::OpmlParsingComplete(TInt aError, TUint aNumFeedsImported)
 	{
 	TRAP_IGNORE(OpmlParsingCompleteL(aError, aNumFeedsImported));