voicerecorder/AppSrc/CVRSettingsDialogMMCSupported.cpp
branchRCL_3
changeset 29 c9b63fff5abf
parent 25 c6bafb5162d8
equal deleted inserted replaced
27:41fba8bcf7b7 29:c9b63fff5abf
    34 
    34 
    35 #ifdef RD_MULTIPLE_DRIVE
    35 #ifdef RD_MULTIPLE_DRIVE
    36 #include <AknCommonDialogsDynMem.h>
    36 #include <AknCommonDialogsDynMem.h>
    37 #include <driveinfo.h>
    37 #include <driveinfo.h>
    38 #include <CAknMemorySelectionDialogMultiDrive.h>
    38 #include <CAknMemorySelectionDialogMultiDrive.h>
    39 #include <CAknMemorySelectionSettingItemMultiDrive.h>
    39 #endif
    40 #endif
    40 
    41 
       
    42 // ListBox item index
       
    43 enum TListItemIndex
       
    44     {
       
    45     EListItemQualityIndex = 0,
       
    46     ElistItemMemoStoreIndex,
       
    47     };
       
    48 // ---------------------------------------------------------------------------
    41 // ---------------------------------------------------------------------------
    49 // CVRSettingsDialog::~CVRSettingsDialog
    42 // CVRSettingsDialog::~CVRSettingsDialog
    50 // 
    43 // 
    51 // ---------------------------------------------------------------------------
    44 // ---------------------------------------------------------------------------
    52 //
    45 //
   136 										( Control( EVRSettingsListboxId ) );
   129 										( Control( EVRSettingsListboxId ) );
   137 	User::LeaveIfNull( listBox );
   130 	User::LeaveIfNull( listBox );
   138     CAknSettingItem* settingItem;
   131     CAknSettingItem* settingItem;
   139   
   132   
   140     HBufC* itemTitle;
   133     HBufC* itemTitle;
       
   134    	TInt id( 0 );
   141     if ( VRUtils::FeatureEnabled( EVRFeatureShowQualitySetting ) )
   135     if ( VRUtils::FeatureEnabled( EVRFeatureShowQualitySetting ) )
   142         {
   136         {
   143     	// Add quality setting
   137     	// Add quality setting
   144 #ifdef  __AAC_ENCODER_PLUGIN    	
   138 #ifdef  __AAC_ENCODER_PLUGIN    	
   145     	settingItem = new( ELeave ) CAknEnumeratedTextPopupSettingItem ( 0, ( TInt& ) iQuality );
   139     	settingItem = new( ELeave ) CAknEnumeratedTextPopupSettingItem ( 0, ( TInt& ) iQuality );
   149 #endif
   143 #endif
   150 
   144 
   151     	CleanupStack::PushL( settingItem );
   145     	CleanupStack::PushL( settingItem );
   152 
   146 
   153     	itemTitle = iCoeEnv->AllocReadResourceLC( R_QTN_VOREC_SET_QUALITY );
   147     	itemTitle = iCoeEnv->AllocReadResourceLC( R_QTN_VOREC_SET_QUALITY );
   154     	settingItem->ConstructL( EFalse, EListItemQualityIndex, *itemTitle, NULL,
   148     	settingItem->ConstructL( EFalse, id, *itemTitle, NULL,
   155     	                     R_VR_SETTINGS_DEFAULT_SPEAKER_PAGE, EAknCtPopupField, NULL,
   149     	                     R_VR_SETTINGS_DEFAULT_SPEAKER_PAGE, EAknCtPopupField, NULL,
   156     						 R_VR_SETTINGS_QUALITY_TEXTS );
   150     						 R_VR_SETTINGS_QUALITY_TEXTS );
   157     	CleanupStack::PopAndDestroy();		// itemTitle
   151     	CleanupStack::PopAndDestroy();		// itemTitle
   158 
   152 
   159     	// Add quality item to the settings array
   153     	// Add quality item to the settings array
   160     	iSettingItemArray.AppendL( settingItem ); 
   154     	iSettingItemArray.AppendL( settingItem ); 
   161     	CleanupStack::Pop();	// settingItem
   155     	CleanupStack::Pop();	// settingItem
       
   156     	id++;
   162         }
   157         }
   163 
   158 
   164     if ( VRUtils::MultipleMassStorageAvailable() )
   159     if ( VRUtils::MultipleMassStorageAvailable() )
   165     	{
   160     	{
   166     	// Create the memo store item
   161     	// Create the memo store item
   176 	iSettingItemArray.AppendL( settingItem );
   171 	iSettingItemArray.AppendL( settingItem );
   177 	id++;
   172 	id++;
   178 	CleanupStack::Pop();	// settingItem
   173 	CleanupStack::Pop();	// settingItem
   179 
   174 
   180 #else    //multiple drives
   175 #else    //multiple drives
   181         settingItem = new( ELeave ) CAknMemorySelectionSettingItemMultiDrive(0, iDrive );
   176 
   182         CleanupStack::PushL( settingItem );
   177 	CAknMemorySelectionDialogMultiDrive* dlg = CAknMemorySelectionDialogMultiDrive::NewL(
   183         TInt includedMedias = AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage |
   178     ECFDDialogTypeNormal, 
   184                                  AknCommonDialogsDynMem::EMemoryTypeMMCExternal;
   179     R_VOREC_MEMORY_SELECTION_DIALOG, // Default resource Id
   185         static_cast< CAknMemorySelectionSettingItemMultiDrive *> ( settingItem )->SetIncludedMediasL( includedMedias );
   180     EFalse,
   186         // Set memo store item's title
   181     AknCommonDialogsDynMem::EMemoryTypeInternalMassStorage |
   187         settingItem->ConstructL( EFalse, ElistItemMemoStoreIndex, *itemTitle, NULL, 0, EAknSetListBox );
   182     AknCommonDialogsDynMem::EMemoryTypeMMCExternal);
   188         // Add memo store item to the settings array
   183 
   189         iSettingItemArray.AppendL( settingItem );
   184     CleanupStack::PushL( dlg );
   190         CleanupStack::Pop();	// settingItem
   185     TBool value = dlg->ExecuteL( iDrive );
       
   186     CleanupStack::PopAndDestroy( dlg );
       
   187     if (value)
       
   188      	{
       
   189         VRUtils::SetMemoDriveL( iDrive );
       
   190        	}
   191  
   191  
   192 #endif
   192 #endif
   193 
   193 
   194 		CleanupStack::PopAndDestroy();	// itemTitle
   194 		CleanupStack::PopAndDestroy();	// itemTitle
   195 	}
   195 	}
   224 		case EEventItemDoubleClicked: // Pointer events (highlighted item before pressing) 
   224 		case EEventItemDoubleClicked: // Pointer events (highlighted item before pressing) 
   225 		case EEventEnterKeyPressed:	// Normal button presses
   225 		case EEventEnterKeyPressed:	// Normal button presses
   226 		case EEventEditingStarted: // From ProcessCommand->ECmdChange
   226 		case EEventEditingStarted: // From ProcessCommand->ECmdChange
   227 			{
   227 			{
   228 			TInt index( aListBox->CurrentItemIndex() );
   228 			TInt index( aListBox->CurrentItemIndex() );
   229 			TInt driveDefaultMassStorage = VRUtils::DefaultMemoDriveL();
       
   230 			TInt driveRemovableMassStorage = VRUtils::GetRemovableMassStorageL();
       
   231 			
       
   232 			if ( index >=0 )	// index is -1 if there are no items in the list
   229 			if ( index >=0 )	// index is -1 if there are no items in the list
   233 				{
   230 				{
   234 			    if(index == ElistItemMemoStoreIndex && 
       
   235 			        !VRUtils::DriveValid(driveDefaultMassStorage) && 
       
   236 			            !VRUtils::DriveValid(driveRemovableMassStorage) )
       
   237 			        {
       
   238 			        break;
       
   239 			        }
       
   240 			    iSettingItemArray.At( index )->EditItemL( 
   231 			    iSettingItemArray.At( index )->EditItemL( 
   241 				aEventType == EEventEditingStarted );
   232 				aEventType == EEventEditingStarted );
   242 			    aListBox->DrawItem( index );
   233 			    aListBox->DrawItem( index );
   243 				}
   234 				}
   244 			StoreAllSettingsL();	
   235 			StoreAllSettingsL();	
   342         
   333         
   343         	// use default device drive to save files
   334         	// use default device drive to save files
   344         	iDrive = (TDriveNumber)defaultDrive;
   335         	iDrive = (TDriveNumber)defaultDrive;
   345   			}
   336   			}
   346 	 	}
   337 	 	}
   347     if(iDrive == defaultDrive || iDrive == VRUtils::GetRemovableMassStorageL())
       
   348         {
       
   349         VRUtils::SetMemoDriveL( iDrive );
   338         VRUtils::SetMemoDriveL( iDrive );
   350         }
       
   351 #endif 
   339 #endif 
   352      
   340      
   353     if ( VRUtils::FeatureEnabled( EVRFeatureShowQualitySetting ) )
   341     if ( VRUtils::FeatureEnabled( EVRFeatureShowQualitySetting ) )
   354         {
   342         {
   355         // Save the quality setting	
   343         // Save the quality setting