application/src/PodcastSettingsView.cpp
changeset 105 236022094302
parent 49 43e204e6ae2e
child 106 83752b9e3cb6
equal deleted inserted replaced
104:4d1286f7f982 105:236022094302
    23 #include <aknsettingitemlist.h>
    23 #include <aknsettingitemlist.h>
    24 #include <aknnavide.h> 
    24 #include <aknnavide.h> 
    25 #include <podcast.rsg>
    25 #include <podcast.rsg>
    26 #include "SettingsEngine.h"
    26 #include "SettingsEngine.h"
    27 
    27 
    28 #include <caknfileselectiondialog.h> 
    28 //#include <caknfileselectiondialog.h> 
    29 #include <caknmemoryselectiondialog.h> 
    29 //#include <caknmemoryselectiondialogmultidrive.h> 
       
    30 #include <akncommondialogsdynmem.h> 
    30 #include <pathinfo.h>
    31 #include <pathinfo.h>
    31 
    32 
    32 
    33 
    33 class CIapSetting: public CAknEnumeratedTextPopupSettingItem 
    34 class CIapSetting: public CAknEnumeratedTextPopupSettingItem 
    34 { 
    35 { 
   287 
   288 
   288 	void  EditItemL (TInt aIndex, TBool aCalledFromMenu)
   289 	void  EditItemL (TInt aIndex, TBool aCalledFromMenu)
   289 		{
   290 		{
   290 		DP("EditItemL BEGIN");
   291 		DP("EditItemL BEGIN");
   291 		if (aIndex == 0) {
   292 		if (aIndex == 0) {
   292 			CAknMemorySelectionDialog* memDlg = 
   293 			TFileName selectedFolder;
   293 				CAknMemorySelectionDialog::NewL(ECFDDialogTypeNormal, ETrue);
   294 			selectedFolder.Copy(iShowDir);
   294 			CleanupStack::PushL(memDlg);
   295 			TFileName startFolder;
   295 			CAknMemorySelectionDialog::TMemory memory = 
   296 			startFolder.Zero();
   296 				CAknMemorySelectionDialog::EPhoneMemory;
   297 			TInt types = AknCommonDialogsDynMem::EMemoryTypePhone | AknCommonDialogsDynMem::EMemoryTypeMMC |AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage| AknCommonDialogsDynMem::EMemoryTypeRemote;
   297 	
       
   298 			if (memDlg->ExecuteL(memory))
       
   299 				{
       
   300 				TFileName importName;
       
   301 			
   298 			
   302 				if (memory==CAknMemorySelectionDialog::EMemoryCard)
   299 			HBufC *title = iCoeEnv->AllocReadResourceLC(R_PODCAST_SETTING_DIRECTORY);
   303 				{
   300 			if (AknCommonDialogsDynMem::RunFolderSelectDlgLD (types, selectedFolder,
   304 					importName = PathInfo:: MemoryCardRootPath();
   301 					startFolder, NULL, NULL, *title))
       
   302 				{
       
   303 				_LIT(KPodcastsDir, "Podcasts");
       
   304 				if (selectedFolder.Find(KPodcastsDir) != selectedFolder.Length()-9)
       
   305 					{
       
   306 					// append "Podcasts" if the folder isn't already called this
       
   307 					selectedFolder.Append(KPodcastsDir);
       
   308 					}
       
   309 				iShowDir.Copy(selectedFolder);
       
   310 				LoadSettingsL();
   305 				}
   311 				}
   306 				else
   312 			CleanupStack::PopAndDestroy(title);
   307 				{
       
   308 					importName = PathInfo:: PhoneMemoryRootPath();
       
   309 				}
       
   310 	
       
   311 				CAknFileSelectionDialog* dlg = CAknFileSelectionDialog::NewL(ECFDDialogTypeSave, R_PODCAST_SHOWDIR_SELECTOR);
       
   312 				HBufC* select = iEikonEnv->AllocReadResourceLC(R_PODCAST_SOFTKEY_SELECT);
       
   313 				dlg->SetLeftSoftkeyFileL(*select);
       
   314 				CleanupStack::PopAndDestroy(select);
       
   315 				CleanupStack::PushL(dlg);
       
   316 	
       
   317 				dlg->SetDefaultFolderL(importName);
       
   318 				
       
   319 				if(dlg->ExecuteL(importName))
       
   320 					{
       
   321 					importName.Append(_L("Podcasts"));
       
   322 					iShowDir.Copy(importName);
       
   323 					LoadSettingsL();
       
   324 					}
       
   325 				CleanupStack::PopAndDestroy(dlg);
       
   326 				}
       
   327 			CleanupStack::PopAndDestroy(memDlg);								
       
   328 			}
   313 			}
   329 		else {
   314 		else {
   330 			CAknSettingItemList::EditItemL(aIndex,aCalledFromMenu);
   315 			CAknSettingItemList::EditItemL(aIndex,aCalledFromMenu);
   331 		}
   316 		}
   332 			StoreSettingsL();
   317 			StoreSettingsL();