417 { |
404 { |
418 // qtn.memc.mmc.locked.double |
405 // qtn.memc.mmc.locked.double |
419 resource = R_CFD_QTN_MEMC_MMC_LOCKED_DOUBLE; |
406 resource = R_CFD_QTN_MEMC_MMC_LOCKED_DOUBLE; |
420 break; |
407 break; |
421 } |
408 } |
|
409 case ETextMMCUnavailable: |
|
410 { |
|
411 // qtn.memc.mmc.unavailable.double |
|
412 resource = R_CFD_QTN_MEMC_MMC_UNAVAILABLE_DOUBLE; |
|
413 break; |
|
414 } |
422 case ETextRemoteDrive: |
415 case ETextRemoteDrive: |
423 { |
416 { |
424 // TODO: To be checked because of missing data in UI spec. |
417 // TODO: To be checked because of missing data in UI spec. |
425 resource = R_CFD_QTN_MEMC_REMOTE_DRIVE_DOUBLE_LIST; |
418 resource = R_CFD_QTN_MEMC_REMOTE_DRIVE_DOUBLE_LIST; |
426 break; |
419 break; |
427 } |
420 } |
428 case ETextUSBDefaultName: |
|
429 { |
|
430 // qtn.memc.usb.available.double |
|
431 resource = R_CFD_QTN_MEMC_USB_AVAILABLE_DOUBLE; |
|
432 break; |
|
433 } |
|
434 case ETextMMCUnavailable: |
|
435 case ETextUSBUnavailable: |
|
436 case ETextInternalMassStorageUnavailable: |
|
437 { |
|
438 // Unavailable:qtn.memc.mmc.unavailable.double |
|
439 // Only for second row |
|
440 resource = R_CFD_QTN_MEMC_MMC_UNAVAILABLE_DOUBLE; |
|
441 break; |
|
442 } |
|
443 } |
421 } |
444 return resource; |
422 return resource; |
445 |
423 |
446 } |
424 } |
447 |
425 |
469 } |
447 } |
470 } |
448 } |
471 else if( aDriveInfo.iStatus & DriveInfo::EDriveRemovable ) |
449 else if( aDriveInfo.iStatus & DriveInfo::EDriveRemovable ) |
472 { |
450 { |
473 // External mass storage drive, like external MMC |
451 // External mass storage drive, like external MMC |
474 if( aDriveInfo.iStatus & DriveInfo::EDriveUsbMemory ) |
452 AddMMCItemToLbxL( aDriveInfo ); |
475 { |
453 |
476 AddUSBItemToLbxL( aDriveInfo ); |
454 iHasMMCUnavailable = ( aDriveInfo.iDriveStatus == EDriveNotReady ); |
477 } |
|
478 else |
|
479 { |
|
480 AddMMCItemToLbxL( aDriveInfo ); |
|
481 iHasMMCUnavailable = ( aDriveInfo.iDriveStatus == EDriveNotReady ); |
|
482 } |
|
483 } |
455 } |
484 else if ( ( aDriveInfo.iStatus & DriveInfo::EDriveRemote ) |
456 else if ( ( aDriveInfo.iStatus & DriveInfo::EDriveRemote ) |
485 && ( aDriveInfo.iMediaType == EMediaRemote ) ) |
457 && ( aDriveInfo.iMediaType == EMediaRemote ) ) |
486 // 2 conditions used here just for sure |
458 // 2 conditions used here just for sure |
487 { |
459 { |
933 CleanupStack::Pop( lbxItemBuf ); |
905 CleanupStack::Pop( lbxItemBuf ); |
934 _LOG1( "[CAknMemorySelectionModelMultiDrive] Item string added to lbx array: %S", &itemString ); |
906 _LOG1( "[CAknMemorySelectionModelMultiDrive] Item string added to lbx array: %S", &itemString ); |
935 _LOG1( "itemString length=%d", itemString.Length() ); |
907 _LOG1( "itemString length=%d", itemString.Length() ); |
936 } |
908 } |
937 |
909 |
938 // --------------------------------------------------------------------------- |
|
939 // CAknMemorySelectionModelMultiDrive::AddUSBItemToLbxL |
|
940 // --------------------------------------------------------------------------- |
|
941 // |
|
942 void CAknMemorySelectionModelMultiDrive::AddUSBItemToLbxL( |
|
943 const TCFDDriveInfo& aDriveInfo ) |
|
944 { |
|
945 HBufC* lbxItemBuf = HBufC::NewLC( KListBoxEntryMaxLength ); |
|
946 TPtr itemString( lbxItemBuf->Des() ); |
|
947 HBufC* textItemBuf = HBufC::NewLC( KListBoxEntryMaxLength ); |
|
948 TPtr textString( textItemBuf->Des() ); |
|
949 HBufC* textItemBuf2 = HBufC::NewLC( KListBoxEntryMaxLength ); |
|
950 TPtr textString2( textItemBuf2->Des() ); |
|
951 TDriveUnit driveUnit( aDriveInfo.iDriveNumber ); |
|
952 |
|
953 // Item text is affected by layout |
|
954 switch( iLayout ) |
|
955 { |
|
956 case ELayoutPopupMenu: |
|
957 { |
|
958 itemString.Format( KImageHeader, EIconExternalUSBDrive ); |
|
959 itemString.Append( KTabChar ); |
|
960 |
|
961 // 1st row text: |
|
962 if( aDriveInfo.iDriveStatus == EDriveOK ) |
|
963 { |
|
964 if( aDriveInfo.iVolumeLabel.Length() > 0 ) |
|
965 { |
|
966 StringLoader::Format( |
|
967 textString2, |
|
968 *iLocStringArray[ ETextMMCNamed ], |
|
969 KIndexFirst, |
|
970 driveUnit.Name() |
|
971 ); |
|
972 StringLoader::Format( |
|
973 textString, |
|
974 textString2, |
|
975 KIndexSecond, |
|
976 aDriveInfo.iVolumeLabel |
|
977 ); |
|
978 } |
|
979 else |
|
980 { |
|
981 StringLoader::Format( |
|
982 textString, |
|
983 *iLocStringArray[ ETextUSBDefaultName ], |
|
984 KNoIndex, |
|
985 driveUnit.Name() |
|
986 ); |
|
987 } |
|
988 } |
|
989 else |
|
990 { |
|
991 StringLoader::Format( |
|
992 textString, |
|
993 *iLocStringArray[ ETextUSBUnavailable ], |
|
994 KNoIndex, |
|
995 driveUnit.Name() |
|
996 ); |
|
997 } |
|
998 itemString.Append( textString ); |
|
999 |
|
1000 break; |
|
1001 } |
|
1002 case ELayoutSettingPage: |
|
1003 { |
|
1004 // 1st row text: |
|
1005 if( aDriveInfo.iVolumeLabel.Length() > 0 ) |
|
1006 { |
|
1007 // Append drive name if it has one |
|
1008 StringLoader::Format( |
|
1009 textString, |
|
1010 *iLocStringArray[ ETextMMCNamed ], |
|
1011 KIndexFirst, |
|
1012 driveUnit.Name() |
|
1013 ); |
|
1014 StringLoader::Format( |
|
1015 itemString, |
|
1016 textString, |
|
1017 KIndexSecond, |
|
1018 aDriveInfo.iVolumeLabel |
|
1019 ); |
|
1020 } |
|
1021 else |
|
1022 { |
|
1023 StringLoader::Format( |
|
1024 itemString, |
|
1025 *iLocStringArray[ ETextUSBDefaultName ], |
|
1026 KNoIndex, |
|
1027 driveUnit.Name() |
|
1028 ); |
|
1029 } |
|
1030 break; |
|
1031 } |
|
1032 case ELayoutDoublePopup: |
|
1033 { |
|
1034 itemString.Format( KImageHeader, EIconExternalUSBDrive ); |
|
1035 itemString.Append( KTabChar ); |
|
1036 |
|
1037 // 1st row text: |
|
1038 if( aDriveInfo.iVolumeLabel.Length() > 0 ) |
|
1039 { |
|
1040 StringLoader::Format( |
|
1041 textString2, |
|
1042 *iLocStringArray[ ETextMMCNamed ], |
|
1043 KIndexFirst, |
|
1044 driveUnit.Name() |
|
1045 ); |
|
1046 StringLoader::Format( |
|
1047 textString, |
|
1048 textString2, |
|
1049 KIndexSecond, |
|
1050 aDriveInfo.iVolumeLabel |
|
1051 ); |
|
1052 } |
|
1053 else |
|
1054 { |
|
1055 // Use default drive description |
|
1056 StringLoader::Format( |
|
1057 textString, |
|
1058 *iLocStringArray[ ETextUSBDefaultName ], |
|
1059 KNoIndex, |
|
1060 driveUnit.Name() |
|
1061 ); |
|
1062 } |
|
1063 itemString.Append( textString ); |
|
1064 itemString.Append( KTabChar ); |
|
1065 |
|
1066 // 2nd row text: |
|
1067 if ( aDriveInfo.iDriveStatus == EDriveOK ) |
|
1068 { |
|
1069 HBufC* buffer; |
|
1070 TInt64 freeSpace = aDriveInfo.iDiskSpace; |
|
1071 if ( freeSpace >= 0 ) |
|
1072 { |
|
1073 buffer = HBufC::NewLC( KListBoxEntryMaxLength ); |
|
1074 TPtr unitStr( buffer->Des() ); |
|
1075 AknCFDUtility::SetSecondRowTextL( freeSpace, unitStr ); |
|
1076 } |
|
1077 else |
|
1078 { |
|
1079 // Disk space is unavailable |
|
1080 buffer = StringLoader::LoadLC( |
|
1081 R_CFD_QTN_MEMC_SPACE_NOT_AVAILABLE, |
|
1082 iCoeEnv); |
|
1083 } |
|
1084 itemString.Append( *buffer );//Free mem text |
|
1085 CleanupStack::PopAndDestroy( buffer ); |
|
1086 } |
|
1087 else |
|
1088 { |
|
1089 itemString.Append( |
|
1090 *iLocStringArray[ ETextUSBUnavailable ] ); |
|
1091 } |
|
1092 break; |
|
1093 } |
|
1094 } |
|
1095 |
|
1096 // Finally!: append the formatted string to listbox |
|
1097 User::LeaveIfError( iListBoxArray.Append( lbxItemBuf ) ); |
|
1098 CleanupStack::PopAndDestroy( 2 ); // textItemBuf2, textItemBuf |
|
1099 CleanupStack::Pop( lbxItemBuf ); |
|
1100 _LOG1( "[CAknMemorySelectionModelMultiDrive] Item string added to lbx array: %S", &itemString ); |
|
1101 _LOG1( "itemString length=%d", itemString.Length() ); |
|
1102 } |
|
1103 |
910 |
1104 // --------------------------------------------------------------------------- |
911 // --------------------------------------------------------------------------- |
1105 // CAknMemorySelectionModelMultiDrive::AddRemoteItemToLbxL |
912 // CAknMemorySelectionModelMultiDrive::AddRemoteItemToLbxL |
1106 // --------------------------------------------------------------------------- |
913 // --------------------------------------------------------------------------- |
1107 // |
914 // |
1173 // Currently Remote drive does not support query for available |
980 // Currently Remote drive does not support query for available |
1174 // disk space, so just return " " |
981 // disk space, so just return " " |
1175 _LIT( KEmptySpace, " "); |
982 _LIT( KEmptySpace, " "); |
1176 itemString.Append( KEmptySpace ); |
983 itemString.Append( KEmptySpace ); |
1177 |
984 |
1178 if( aDriveInfo.iConnectionState == KMountStronglyConnected ) |
985 //if( aDriveInfo.iConnectionState == KMountStronglyConnected ) |
1179 { |
986 // { |
|
987 // D-column icon: Show active icon if drive has no error |
|
988 // itemString.Append( KTabChar ); |
|
989 // itemString.AppendFormat( |
|
990 // KImageHeader, EIconRemoteDriveActive ); |
|
991 // } |
|
992 //else // KMountNotConnected |
|
993 // { |
1180 // D-column icon: Show active icon if drive has no error |
994 // D-column icon: Show active icon if drive has no error |
1181 itemString.Append( KTabChar ); |
995 itemString.Append( KTabChar ); |
1182 itemString.AppendFormat( |
996 // } |
1183 KImageHeader, EIconRemoteDriveActive ); |
|
1184 } |
|
1185 else // KMountNotConnected |
|
1186 { |
|
1187 // D-column icon: Show active icon if drive has no error |
|
1188 itemString.Append( KTabChar ); |
|
1189 } |
|
1190 } |
997 } |
1191 else |
998 else |
1192 { |
999 { |
1193 // 2nd row text: |
1000 // 2nd row text: |
1194 itemString.Append( *iLocStringArray[ ETextMMCUnavailable ] ); |
1001 itemString.Append( *iLocStringArray[ ETextMMCUnavailable ] ); |
1401 TInt drive = driveList[i]; |
1193 TInt drive = driveList[i]; |
1402 driveNumber = TDriveNumber( i ); |
1194 driveNumber = TDriveNumber( i ); |
1403 if (drive) |
1195 if (drive) |
1404 { |
1196 { |
1405 memoryType = AknCFDUtility::DriveMemoryTypeL( driveNumber ); |
1197 memoryType = AknCFDUtility::DriveMemoryTypeL( driveNumber ); |
1406 if ( memoryType == AknCommonDialogsDynMem::EMemoryTypeMMCExternal && |
|
1407 ( iIncludedMedias & AknCommonDialogsDynMem::EMemoryTypeMMCExternalInDevice ) ) |
|
1408 { |
|
1409 // Hide usb memory |
|
1410 TCFDDriveInfo info; |
|
1411 AknCFDUtility::DriveInfoL( driveNumber, info ); |
|
1412 if ( info.iStatus & DriveInfo::EDriveUsbMemory ) |
|
1413 { |
|
1414 continue; |
|
1415 } |
|
1416 else |
|
1417 { |
|
1418 memoryType = AknCommonDialogsDynMem::EMemoryTypeMMCExternalInDevice; |
|
1419 } |
|
1420 } |
|
1421 if( memoryType & iIncludedMedias ) |
1198 if( memoryType & iIncludedMedias ) |
1422 { |
1199 { |
1423 User::LeaveIfError( |
1200 User::LeaveIfError( |
1424 PathInfo::GetRootPath( rootPath, driveNumber ) ); |
1201 PathInfo::GetRootPath( rootPath, driveNumber ) ); |
1425 driveArray->AppendL( rootPath ); |
1202 driveArray->AppendL( rootPath ); |