Further UI tweaks newlist
authorSebastian Brannstrom <sebastianb@symbian.org>
Mon, 15 Nov 2010 22:54:58 +0000
branchnewlist
changeset 354 a2713e6a41a9
parent 353 33963ffd3082
child 355 075b3a49cb55
Further UI tweaks
application/data/PodcastClient_english.rls
application/data/PodcastShowsView.ra
application/inc/buildno.h
application/sis/buildno.txt
application/sis/podcatcher_udeb.pkg
application/sis/podcatcher_udeb_template.pkg
application/sis/podcatcher_urel.pkg
application/sis/podcatcher_urel_template.pkg
application/src/PodcastShowsView.cpp
engine/src/ConnectionEngine.cpp
engine/src/ShowEngine.cpp
--- a/application/data/PodcastClient_english.rls	Mon Nov 15 21:37:46 2010 +0000
+++ b/application/data/PodcastClient_english.rls	Mon Nov 15 22:54:58 2010 +0000
@@ -20,6 +20,7 @@
 
 rls_string STRING_r_settings_cmd "Settings"
 rls_string STRING_r_view_mark_all_played_cmd "Mark all shows old"
+rls_string STRING_r_view_mark_all_played_cmd_short "Mark all old"
 rls_string STRING_r_exit_cmd "Exit"
 rls_string STRING_r_view_help "Help"
 rls_string STRING_r_view_about_cmd "About"
@@ -142,8 +143,8 @@
 rls_string STRING_r_view_resume_short_dls_cmd "Resume"
 rls_string STRING_r_view_stop_downloads_cmd "Suspend downloading"
 rls_string STRING_r_view_resume_downloads_cmd "Resume downloading"
-rls_string STRING_r_view_remove_all_downloads_cmd_short "Remove all downloads"
-rls_string STRING_r_view_remove_all_downloads_cmd "Remove all"
+rls_string STRING_r_view_remove_all_downloads_cmd_short "Remove"
+rls_string STRING_r_view_remove_all_downloads_cmd "Remove all downloads"
 rls_string STRING_r_clear_query "Remove all downloads?"
 rls_string STRING_r_view_remove_download_short_cmd "Remove"
 rls_string STRING_r_view_move_up_short_cmd "Move up"
--- a/application/data/PodcastShowsView.ra	Mon Nov 15 21:37:46 2010 +0000
+++ b/application/data/PodcastShowsView.ra	Mon Nov 15 22:54:58 2010 +0000
@@ -37,6 +37,11 @@
         {
         MENU_ITEM
 			{
+			command = EPodcastMarkAllPlayed;
+			txt = STRING_r_view_mark_all_played_cmd_short;
+			},
+        MENU_ITEM
+			{
 			command = EPodcastAbout;
 			txt = STRING_r_view_about_cmd;
 			}, 
--- a/application/inc/buildno.h	Mon Nov 15 21:37:46 2010 +0000
+++ b/application/inc/buildno.h	Mon Nov 15 22:54:58 2010 +0000
@@ -1,2 +1,2 @@
 // Build number generated by increment_buildno.py, do not edit manually
-#define BUILD_NO 33
\ No newline at end of file
+#define BUILD_NO 1
\ No newline at end of file
--- a/application/sis/buildno.txt	Mon Nov 15 21:37:46 2010 +0000
+++ b/application/sis/buildno.txt	Mon Nov 15 22:54:58 2010 +0000
@@ -1,1 +1,1 @@
-33
\ No newline at end of file
+1
\ No newline at end of file
--- a/application/sis/podcatcher_udeb.pkg	Mon Nov 15 21:37:46 2010 +0000
+++ b/application/sis/podcatcher_udeb.pkg	Mon Nov 15 22:54:58 2010 +0000
@@ -1,7 +1,7 @@
 &EN,SP
 :"Symbian Foundation"
 %{"Podcatcher","Podcatcher"}
-#{"Podcatcher","Podcatcher"},(0xA0009D00), 1, 00, 33, TYPE=SA
+#{"Podcatcher","Podcatcher"},(0xA0009D00), 1, 10, 1, TYPE=SA
 
 ;Supports Symbian^1
 [0x1028315F], 0, 0, 0, {"Series60ProductID","Series60ProductID"}
--- a/application/sis/podcatcher_udeb_template.pkg	Mon Nov 15 21:37:46 2010 +0000
+++ b/application/sis/podcatcher_udeb_template.pkg	Mon Nov 15 22:54:58 2010 +0000
@@ -1,7 +1,7 @@
 &EN,SP
 :"Symbian Foundation"
 %{"Podcatcher","Podcatcher"}
-#{"Podcatcher","Podcatcher"},(0xA0009D00), 1, 00, BUILDNO, TYPE=SA
+#{"Podcatcher","Podcatcher"},(0xA0009D00), 1, 10, BUILDNO, TYPE=SA
 
 ;Supports Symbian^1
 [0x1028315F], 0, 0, 0, {"Series60ProductID","Series60ProductID"}
--- a/application/sis/podcatcher_urel.pkg	Mon Nov 15 21:37:46 2010 +0000
+++ b/application/sis/podcatcher_urel.pkg	Mon Nov 15 22:54:58 2010 +0000
@@ -1,7 +1,7 @@
 &EN,SP
 :"Symbian Foundation"
 %{"Podcatcher","Podcatcher"}
-#{"Podcatcher","Podcatcher"},(0xA0009D00), 1, 00, 33, TYPE=SA
+#{"Podcatcher","Podcatcher"},(0xA0009D00), 1, 10, 1, TYPE=SA
 
 ;Supports Symbian^1
 [0x1028315F], 0, 0, 0, {"Series60ProductID","Series60ProductID"}
--- a/application/sis/podcatcher_urel_template.pkg	Mon Nov 15 21:37:46 2010 +0000
+++ b/application/sis/podcatcher_urel_template.pkg	Mon Nov 15 22:54:58 2010 +0000
@@ -1,7 +1,7 @@
 &EN,SP
 :"Symbian Foundation"
 %{"Podcatcher","Podcatcher"}
-#{"Podcatcher","Podcatcher"},(0xA0009D00), 1, 00, BUILDNO, TYPE=SA
+#{"Podcatcher","Podcatcher"},(0xA0009D00), 1, 10, BUILDNO, TYPE=SA
 
 ;Supports Symbian^1
 [0x1028315F], 0, 0, 0, {"Series60ProductID","Series60ProductID"}
--- a/application/src/PodcastShowsView.cpp	Mon Nov 15 21:37:46 2010 +0000
+++ b/application/src/PodcastShowsView.cpp	Mon Nov 15 22:54:58 2010 +0000
@@ -415,7 +415,6 @@
 	{
 	TBool dlStop = iPodcastModel.SettingsEngine().DownloadSuspended();
 	TBool isNew = aShowInfo->PlayState() == ENeverPlayed;
-	DP1("downloadstate=%d", aShowInfo->DownloadState());
 	switch (aShowInfo->DownloadState())
 		{
 		case EDownloaded:
@@ -443,7 +442,7 @@
 		aIconIndex += KVideoIconOffset;
 		}
 	
-	DP3("dlStop=%d, isNew=%d, aIconIndex=%d", dlStop, isNew, aIconIndex);
+	//DP3("dlStop=%d, isNew=%d, aIconIndex=%d", dlStop, isNew, aIconIndex);
 	}
 	
 
@@ -476,8 +475,9 @@
 		{
 		if (aShowInfo.ShowSize() > 0)
 			{
+				TUint showSize = aShowInfo.ShowSize() >= aSizeDownloaded ? aShowInfo.ShowSize() : aSizeDownloaded;
 				infoSize.Format(KSizeDownloadingOf(), ((float) aSizeDownloaded / (float) KSizeMb),
-						((float)aShowInfo.ShowSize() / (float)KSizeMb));
+						((float) showSize / (float)KSizeMb));
 			}
 		else
 			{
@@ -648,11 +648,9 @@
 		{
 		case EPodcastMarkAsPlayed:
 			HandleSetShowPlayedL(ETrue);
-			if (iShowNewShows) UpdateListboxItemsL();
 			break;
 		case EPodcastMarkAsUnplayed:
 			HandleSetShowPlayedL(EFalse);
-			if (iShowNewShows) UpdateListboxItemsL();
 			break;
 		case EPodcastMarkAllPlayed:
 			iPodcastModel.MarkSelectionPlayedL();
@@ -809,7 +807,8 @@
 			toolbar->HideItem(EPodcastMarkAsUnplayed, ETrue, ETrue );
 			
 			TBool showDownloadAll = EFalse;
-			for (int i=0;i<iPodcastModel.ActiveShowList().Count();i++)
+			TInt count = iPodcastModel.ActiveShowList().Count();
+			for (int i=0;i<count;i++)
 				{
 				CShowInfo* info = iPodcastModel.ActiveShowList()[i];
 				if (info->DownloadState() == ENotDownloaded)
@@ -818,6 +817,7 @@
 					}
 				}
 	
+			toolbar->SetItemDimmed(EPodcastMarkAllPlayed, !count, ETrue);
 			toolbar->SetItemDimmed(EPodcastDownloadAll, !showDownloadAll, ETrue);
 			}
 		else
@@ -923,9 +923,30 @@
 		{
 		CShowInfo *info = iPodcastModel.ActiveShowList()[index];
 		info->SetPlayState(aPlayed ? EPlayed : ENeverPlayed);
-		iPodcastModel.ShowEngine().UpdateShowL(*info);
-		UpdateShowItemDataL(iPodcastModel.ActiveShowList()[index], index, 0);
-		iListContainer->Listbox()->DrawItem(index);					
+		if (aPlayed)
+			{
+			// PostPlayHandling calls UpdateShow, which is slow, so we don't need to do it again
+			iPodcastModel.ShowEngine().PostPlayHandling(info);
+			}
+		else
+			{
+			iPodcastModel.ShowEngine().UpdateShowL(*info);
+			}
+		
+		if (iShowNewShows)
+			{
+			UpdateListboxItemsL();
+
+			if (index > 0)
+				{
+				iListContainer->Listbox()->SetCurrentItemIndex(index - 1);
+				}
+			}
+		else
+			{
+			UpdateShowItemDataL(iPodcastModel.ActiveShowList()[index], index, 0);
+			iListContainer->Listbox()->DrawItem(index);	
+			}
 		}
 	}
 
--- a/engine/src/ConnectionEngine.cpp	Mon Nov 15 21:37:46 2010 +0000
+++ b/engine/src/ConnectionEngine.cpp	Mon Nov 15 22:54:58 2010 +0000
@@ -309,11 +309,9 @@
 	{
 	DP1("CConnectionEngine::ReportConnectionL, aError=%d", aError);
 	TInt noObservers = iObserverArray.Count();
-	DP1("    noObservers=%d", noObservers);
 	while(noObservers)
 		{
 		noObservers--;
-		DP("    calling callback");
 		iObserverArray[noObservers]->ConnectCompleteL(aError);
 		}
 	}
--- a/engine/src/ShowEngine.cpp	Mon Nov 15 21:37:46 2010 +0000
+++ b/engine/src/ShowEngine.cpp	Mon Nov 15 22:54:58 2010 +0000
@@ -519,8 +519,11 @@
 	DP("CShowEngine::DBGetOldShowsL BEGIN");
 	TTime now;
 	now.HomeTime();
-	_LIT(KSqlStatement, "select filename, deletedate shows where deletedate < %Ld");
-	iSqlBuffer.Format(KSqlStatement, now.Int64());
+//	TTimeIntervalYears years(5);
+//	now += years;
+	
+	_LIT(KSqlStatement, "select filename from shows where downloadstate=%d and deletedate < \"%Ld\"");
+	iSqlBuffer.Format(KSqlStatement, EDownloaded, now.Int64());
 
 	sqlite3_stmt *st;
 
@@ -535,14 +538,10 @@
 			{
 			CShowInfo* showInfo = CShowInfo::NewLC();
 
-			const void *filez = sqlite3_column_text16(st, 3);
+			const void *filez = sqlite3_column_text16(st, 0);
 			TPtrC16 file((const TUint16*) filez);
 			showInfo->SetFileNameL(file);
 
-			sqlite3_int64 deletedate = sqlite3_column_int64(st, 15);
-			TTime timedeletedate(deletedate);
-			showInfo->SetDeleteDate(timedeletedate);
-
 			aShowArray.Append(showInfo);
 			CleanupStack::Pop(showInfo);
 			rc = sqlite3_step(st);