voicerecorder/gsplugin/src/CVRGSPluginContainer.cpp
branchRCL_3
changeset 29 c9b63fff5abf
parent 25 c6bafb5162d8
equal deleted inserted replaced
27:41fba8bcf7b7 29:c9b63fff5abf
    43 #include <AknCommonDialogsDynMem.h>
    43 #include <AknCommonDialogsDynMem.h>
    44 #endif
    44 #endif
    45 
    45 
    46 const TUid KVRAppUID = { KVoiceRecorderAppUID3 };
    46 const TUid KVRAppUID = { KVoiceRecorderAppUID3 };
    47 
    47 
    48 // ListBox item index
       
    49 enum TListItemIndex
       
    50     {
       
    51     EListItemQualityIndex = 0,
       
    52     ElistItemMemoStoreIndex,
       
    53     };
       
    54 
       
    55 // ========================= MEMBER FUNCTIONS ================================
    48 // ========================= MEMBER FUNCTIONS ================================
    56 
    49 
    57 // ---------------------------------------------------------------------------
    50 // ---------------------------------------------------------------------------
    58 // CVRGSPluginContainer::ConstructL
    51 // CVRGSPluginContainer::ConstructL
    59 // Symbian OS default constructor
    52 // Symbian OS default constructor
   163 //
   156 //
   164 void CVRGSPluginContainer::CreateListBoxItemsL()
   157 void CVRGSPluginContainer::CreateListBoxItemsL()
   165     {
   158     {
   166     CAknSettingItem* settingItem;
   159     CAknSettingItem* settingItem;
   167     HBufC* itemTitle;
   160     HBufC* itemTitle;
       
   161    	TInt id( 0 );    
   168 
   162 
   169 	// Add quality setting
   163 	// Add quality setting
   170     if ( VRUtils::FeatureEnabled( EVRFeatureShowQualitySetting ) )
   164     if ( VRUtils::FeatureEnabled( EVRFeatureShowQualitySetting ) )
   171         {
   165         {
   172  
   166  
   178         settingItem = new( ELeave ) CAknBinaryPopupSettingItem ( 0, ( TInt& ) iQuality );
   172         settingItem = new( ELeave ) CAknBinaryPopupSettingItem ( 0, ( TInt& ) iQuality );
   179 #endif
   173 #endif
   180     	CleanupStack::PushL( settingItem );
   174     	CleanupStack::PushL( settingItem );
   181 
   175 
   182     	itemTitle = iCoeEnv->AllocReadResourceLC( R_QTN_VOREC_SET_QUALITY );
   176     	itemTitle = iCoeEnv->AllocReadResourceLC( R_QTN_VOREC_SET_QUALITY );
   183     	settingItem->ConstructL( EFalse, EListItemQualityIndex, *itemTitle, NULL,
   177     	settingItem->ConstructL( EFalse, id, *itemTitle, NULL,
   184     	                     R_VR_SETTINGS_DEFAULT_SPEAKER_PAGE, 
   178     	                     R_VR_SETTINGS_DEFAULT_SPEAKER_PAGE, 
   185     	                     EAknCtPopupField, NULL,
   179     	                     EAknCtPopupField, NULL,
   186     						 R_VR_SETTINGS_QUALITY_TEXTS );
   180     						 R_VR_SETTINGS_QUALITY_TEXTS );
   187     	
   181     	
   188     	CleanupStack::PopAndDestroy();		// itemTitle
   182     	CleanupStack::PopAndDestroy();		// itemTitle
   189 
   183 
   190     	// Add quality item to the settings array
   184     	// Add quality item to the settings array
   191     	iSettingItemArray->AppendL( settingItem );
   185     	iSettingItemArray->AppendL( settingItem );
   192       	CleanupStack::Pop();	// settingItem        
   186       	CleanupStack::Pop();	// settingItem        
   193         }
   187       	id++;
   194       if ( VRUtils::MultipleMassStorageAvailable() )
   188         }
       
   189     if ( VRUtils::MultipleMassStorageAvailable() )
   195         {
   190         {
   196     // Add memo store setting
   191     // Add memo store setting
   197 	// Create the memo store item
   192 	// Create the memo store item
   198 #ifndef RD_MULTIPLE_DRIVE	
   193 #ifndef RD_MULTIPLE_DRIVE	
   199 	settingItem =
   194 	settingItem =
   214 #ifndef RD_MULTIPLE_DRIVE
   209 #ifndef RD_MULTIPLE_DRIVE
   215 	// Set memo store item's title
   210 	// Set memo store item's title
   216 	settingItem->ConstructL( EFalse, id, *itemTitle, NULL,
   211 	settingItem->ConstructL( EFalse, id, *itemTitle, NULL,
   217 	    R_VOREC_MEMORY_SELECTION_DIALOG, EAknCtPopupSettingList );
   212 	    R_VOREC_MEMORY_SELECTION_DIALOG, EAknCtPopupSettingList );
   218 #else
   213 #else
   219         settingItem->ConstructL( EFalse, ElistItemMemoStoreIndex, *itemTitle, NULL, 0, EAknCtPopupSettingList );
   214    settingItem->ConstructL( EFalse, id, *itemTitle, NULL, 0, EAknCtPopupSettingList );
   220 #endif
   215 #endif
   221 	    
   216 	    
   222 	CleanupStack::PopAndDestroy();	// itemTitle
   217 	CleanupStack::PopAndDestroy();	// itemTitle
   223 
   218 
   224         // Add memo store item to the settings array
   219         // Add memo store item to the settings array
   225         iSettingItemArray->AppendL( settingItem );
   220         iSettingItemArray->AppendL( settingItem );
   226         CleanupStack::Pop();	// settingItem
   221         CleanupStack::Pop();	// settingItem
       
   222         id++;
   227     	}
   223     	}
   228     }
   224     }
   229 
   225 
   230 
   226 
   231 // ---------------------------------------------------------------------------
   227 // ---------------------------------------------------------------------------
   270     }
   266     }
   271   
   267   
   272 void CVRGSPluginContainer::HandleListBoxSelectionL( TInt aCommand ) 
   268 void CVRGSPluginContainer::HandleListBoxSelectionL( TInt aCommand ) 
   273     {
   269     {
   274 	TInt index( iListBox->CurrentItemIndex() );
   270 	TInt index( iListBox->CurrentItemIndex() );
   275 	TInt driveDefaultMassStorage = VRUtils::DefaultMemoDriveL();
   271 
   276 	TInt driveRemovableMassStorage = VRUtils::GetRemovableMassStorageL();
       
   277 	
       
   278 	if ( index >=0 )	// index is -1 if there are no items in the list
   272 	if ( index >=0 )	// index is -1 if there are no items in the list
   279 		{
   273 		{
   280         if(index == ElistItemMemoStoreIndex &&
       
   281 		        !VRUtils::DriveValid(driveDefaultMassStorage) && 
       
   282 		            !VRUtils::DriveValid(driveRemovableMassStorage) )
       
   283             {
       
   284             return;
       
   285             }
       
   286 		// Open edit dialog if EAknCmdOpen, invert the value otherwise
   274 		// Open edit dialog if EAknCmdOpen, invert the value otherwise
   287 		iSettingItemArray->At( index )->EditItemL( aCommand == EAknCmdOpen );
   275 		iSettingItemArray->At( index )->EditItemL( aCommand == EAknCmdOpen );
   288 		iListBox->DrawItem( index );
   276 		iListBox->DrawItem( index );
   289 		//Store all settings after change
   277 		//Store all settings after change
   290 		StoreAllL();
   278 		StoreAllL();
   349         
   337         
   350         	// use default device drive to save files
   338         	// use default device drive to save files
   351         	iDrive = (TDriveNumber)defaultDrive;
   339         	iDrive = (TDriveNumber)defaultDrive;
   352   			}
   340   			}
   353 	 	}
   341 	 	}
   354     if(iDrive == defaultDrive || iDrive == VRUtils::GetRemovableMassStorageL())
       
   355         {
       
   356         VRUtils::SetMemoDriveL( iDrive );
   342         VRUtils::SetMemoDriveL( iDrive );
   357         }
       
   358 #endif 
   343 #endif 
   359 
   344 
   360     // Save quality setting
   345     // Save quality setting
   361     if ( VRUtils::FeatureEnabled( EVRFeatureShowQualitySetting ) )
   346     if ( VRUtils::FeatureEnabled( EVRFeatureShowQualitySetting ) )
   362         {
   347         {