voicerecorder/gsplugin/src/CVRGSPluginContainer.cpp
branchRCL_3
changeset 23 2f5c9ee7098c
parent 18 f962425b9f8b
--- a/voicerecorder/gsplugin/src/CVRGSPluginContainer.cpp	Mon Jun 21 15:43:26 2010 +0300
+++ b/voicerecorder/gsplugin/src/CVRGSPluginContainer.cpp	Thu Aug 19 09:57:40 2010 +0300
@@ -45,6 +45,13 @@
 
 const TUid KVRAppUID = { KVoiceRecorderAppUID3 };
 
+// ListBox item index
+enum TListItemIndex
+    {
+    EListItemQualityIndex = 0,
+    ElistItemMemoStoreIndex,
+    };
+
 // ========================= MEMBER FUNCTIONS ================================
 
 // ---------------------------------------------------------------------------
@@ -158,7 +165,6 @@
     {
     CAknSettingItem* settingItem;
     HBufC* itemTitle;
-   	TInt id( 0 );    
 
 	// Add quality setting
     if ( VRUtils::FeatureEnabled( EVRFeatureShowQualitySetting ) )
@@ -174,7 +180,7 @@
     	CleanupStack::PushL( settingItem );
 
     	itemTitle = iCoeEnv->AllocReadResourceLC( R_QTN_VOREC_SET_QUALITY );
-    	settingItem->ConstructL( EFalse, id, *itemTitle, NULL,
+    	settingItem->ConstructL( EFalse, EListItemQualityIndex, *itemTitle, NULL,
     	                     R_VR_SETTINGS_DEFAULT_SPEAKER_PAGE, 
     	                     EAknCtPopupField, NULL,
     						 R_VR_SETTINGS_QUALITY_TEXTS );
@@ -184,9 +190,8 @@
     	// Add quality item to the settings array
     	iSettingItemArray->AppendL( settingItem );
       	CleanupStack::Pop();	// settingItem        
-      	id++;
         }
-    if ( VRUtils::MultipleMassStorageAvailable() )
+      if ( VRUtils::MultipleMassStorageAvailable() )
         {
     // Add memo store setting
 	// Create the memo store item
@@ -211,7 +216,7 @@
 	settingItem->ConstructL( EFalse, id, *itemTitle, NULL,
 	    R_VOREC_MEMORY_SELECTION_DIALOG, EAknCtPopupSettingList );
 #else
-   settingItem->ConstructL( EFalse, id, *itemTitle, NULL, 0, EAknCtPopupSettingList );
+        settingItem->ConstructL( EFalse, ElistItemMemoStoreIndex, *itemTitle, NULL, 0, EAknCtPopupSettingList );
 #endif
 	    
 	CleanupStack::PopAndDestroy();	// itemTitle
@@ -219,7 +224,6 @@
         // Add memo store item to the settings array
         iSettingItemArray->AppendL( settingItem );
         CleanupStack::Pop();	// settingItem
-        id++;
     	}
     }
 
@@ -268,9 +272,17 @@
 void CVRGSPluginContainer::HandleListBoxSelectionL( TInt aCommand ) 
     {
 	TInt index( iListBox->CurrentItemIndex() );
-
+	TInt driveDefaultMassStorage = VRUtils::DefaultMemoDriveL();
+	TInt driveRemovableMassStorage = VRUtils::GetRemovableMassStorageL();
+	
 	if ( index >=0 )	// index is -1 if there are no items in the list
 		{
+        if(index == ElistItemMemoStoreIndex &&
+		        !VRUtils::DriveValid(driveDefaultMassStorage) && 
+		            !VRUtils::DriveValid(driveRemovableMassStorage) )
+            {
+            return;
+            }
 		// Open edit dialog if EAknCmdOpen, invert the value otherwise
 		iSettingItemArray->At( index )->EditItemL( aCommand == EAknCmdOpen );
 		iListBox->DrawItem( index );
@@ -339,7 +351,10 @@
         	iDrive = (TDriveNumber)defaultDrive;
   			}
 	 	}
+    if(iDrive == defaultDrive || iDrive == VRUtils::GetRemovableMassStorageL())
+        {
         VRUtils::SetMemoDriveL( iDrive );
+        }
 #endif 
 
     // Save quality setting