Fix for bug 2338 - Podcatcher doesn't know about disk F:
authorteknolog
Sat, 03 Apr 2010 14:54:19 +0100
changeset 105 236022094302
parent 104 4d1286f7f982
child 106 83752b9e3cb6
Fix for bug 2338 - Podcatcher doesn't know about disk F:
application/data/PodcastClient_english.rls
application/data/PodcastSettingsView.ra
application/data/PodcastStrings.ra
application/src/PodcastSettingsView.cpp
--- a/application/data/PodcastClient_english.rls	Sat Apr 03 13:33:15 2010 +0100
+++ b/application/data/PodcastClient_english.rls	Sat Apr 03 14:54:19 2010 +0100
@@ -50,7 +50,7 @@
 
 // Settings view
 rls_string STRING_r_podcast_settings_title "Settings"
-rls_string STRING_r_podcast_setting_showdir "Podcast directory"
+rls_string STRING_r_podcast_setting_showdir "Podcast folder"
 rls_string STRING_r_podcast_setting_autoupdate "Automatic update"
 rls_string STRING_r_podcast_setting_autodownload "Automatic download"
 rls_string STRING_r_podcast_setting_connection "Connection"
@@ -58,6 +58,7 @@
 rls_string STRING_r_podcast_setting_alwaysask "Always ask"
 rls_string STRING_r_podcast_setting_useiap "Select access point"
 rls_string STRING_r_podcast_setting_iaplist "Access points"
+rls_string STRING_r_podcast_setting_directory "Select folder"
 rls_string STRING_r_on "On"
 rls_string STRING_r_off "Off"
 
--- a/application/data/PodcastSettingsView.ra	Sat Apr 03 13:33:15 2010 +0100
+++ b/application/data/PodcastSettingsView.ra	Sat Apr 03 14:54:19 2010 +0100
@@ -225,6 +225,18 @@
  };
 }
 
+RESOURCE MEMORYSELECTIONDIALOG r_podcast_memory_selection
+    {
+    title = "Select memory:";
+    softkey_1 = text_softkey_ok; // The text for the left softkey.
+    softkey_2 = text_softkey_cancel; // The text for the right softkey.
+    locations =
+        {
+        LOCATION { root_path =  text_phone_memory_root_path; },
+        LOCATION { root_path = text_memory_card_root_path; }
+        };
+    } 
+
 RESOURCE TBUF r_podcast_softkey_select { buf = STRING_r_view_export_feeds_softkey; }
 RESOURCE TBUF r_settings_title { buf = STRING_r_podcast_settings_title; }
 
--- a/application/data/PodcastStrings.ra	Sat Apr 03 13:33:15 2010 +0100
+++ b/application/data/PodcastStrings.ra	Sat Apr 03 14:54:19 2010 +0100
@@ -64,3 +64,4 @@
 RESOURCE TBUF r_exit_shows_downloading {buf=STRING_r_exit_shows_downloading;}
 RESOURCE TBUF r_search_results {buf=STRING_r_search_results;}
 RESOURCE TBUF r_podcast_no_feeds {buf=STRING_r_podcast_no_feeds;}
+RESOURCE TBUF r_podcast_setting_directory {buf = STRING_r_podcast_setting_directory;}
--- a/application/src/PodcastSettingsView.cpp	Sat Apr 03 13:33:15 2010 +0100
+++ b/application/src/PodcastSettingsView.cpp	Sat Apr 03 14:54:19 2010 +0100
@@ -25,8 +25,9 @@
 #include <podcast.rsg>
 #include "SettingsEngine.h"
 
-#include <caknfileselectiondialog.h> 
-#include <caknmemoryselectiondialog.h> 
+//#include <caknfileselectiondialog.h> 
+//#include <caknmemoryselectiondialogmultidrive.h> 
+#include <akncommondialogsdynmem.h> 
 #include <pathinfo.h>
 
 
@@ -289,42 +290,26 @@
 		{
 		DP("EditItemL BEGIN");
 		if (aIndex == 0) {
-			CAknMemorySelectionDialog* memDlg = 
-				CAknMemorySelectionDialog::NewL(ECFDDialogTypeNormal, ETrue);
-			CleanupStack::PushL(memDlg);
-			CAknMemorySelectionDialog::TMemory memory = 
-				CAknMemorySelectionDialog::EPhoneMemory;
-	
-			if (memDlg->ExecuteL(memory))
+			TFileName selectedFolder;
+			selectedFolder.Copy(iShowDir);
+			TFileName startFolder;
+			startFolder.Zero();
+			TInt types = AknCommonDialogsDynMem::EMemoryTypePhone | AknCommonDialogsDynMem::EMemoryTypeMMC |AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage| AknCommonDialogsDynMem::EMemoryTypeRemote;
+			
+			HBufC *title = iCoeEnv->AllocReadResourceLC(R_PODCAST_SETTING_DIRECTORY);
+			if (AknCommonDialogsDynMem::RunFolderSelectDlgLD (types, selectedFolder,
+					startFolder, NULL, NULL, *title))
 				{
-				TFileName importName;
-			
-				if (memory==CAknMemorySelectionDialog::EMemoryCard)
-				{
-					importName = PathInfo:: MemoryCardRootPath();
-				}
-				else
-				{
-					importName = PathInfo:: PhoneMemoryRootPath();
+				_LIT(KPodcastsDir, "Podcasts");
+				if (selectedFolder.Find(KPodcastsDir) != selectedFolder.Length()-9)
+					{
+					// append "Podcasts" if the folder isn't already called this
+					selectedFolder.Append(KPodcastsDir);
+					}
+				iShowDir.Copy(selectedFolder);
+				LoadSettingsL();
 				}
-	
-				CAknFileSelectionDialog* dlg = CAknFileSelectionDialog::NewL(ECFDDialogTypeSave, R_PODCAST_SHOWDIR_SELECTOR);
-				HBufC* select = iEikonEnv->AllocReadResourceLC(R_PODCAST_SOFTKEY_SELECT);
-				dlg->SetLeftSoftkeyFileL(*select);
-				CleanupStack::PopAndDestroy(select);
-				CleanupStack::PushL(dlg);
-	
-				dlg->SetDefaultFolderL(importName);
-				
-				if(dlg->ExecuteL(importName))
-					{
-					importName.Append(_L("Podcasts"));
-					iShowDir.Copy(importName);
-					LoadSettingsL();
-					}
-				CleanupStack::PopAndDestroy(dlg);
-				}
-			CleanupStack::PopAndDestroy(memDlg);								
+			CleanupStack::PopAndDestroy(title);
 			}
 		else {
 			CAknSettingItemList::EditItemL(aIndex,aCalledFromMenu);