filemanager/App/src/CFileManagerViewBase.cpp
branchRCL_3
changeset 8 1772663c5b4e
parent 5 1e73d2d04cbc
child 9 60626d494346
equal deleted inserted replaced
7:8812206c49a0 8:1772663c5b4e
    84                                   CFileManagerItemProperties::EDefault;
    84                                   CFileManagerItemProperties::EDefault;
    85 const TInt64 KMSecToMicroSecMultiplier = 1000000;
    85 const TInt64 KMSecToMicroSecMultiplier = 1000000;
    86 const TInt64 KMinToMicroSecMultiplier = KMSecToMicroSecMultiplier * 60;
    86 const TInt64 KMinToMicroSecMultiplier = KMSecToMicroSecMultiplier * 60;
    87 const TInt64 KHourToMicroSecMultiplier = KMinToMicroSecMultiplier * 60;
    87 const TInt64 KHourToMicroSecMultiplier = KMinToMicroSecMultiplier * 60;
    88 const TUint KProgressBarAsyncStartDelay = 1500000; // microseconds
    88 const TUint KProgressBarAsyncStartDelay = 1500000; // microseconds
    89 
    89 const TInt KMinificationFactor = 1024; // Used to zoom processbar's proportion
    90 
    90 
    91 // ============================ LOCAL FUNCTIONS ================================
    91 // ============================ LOCAL FUNCTIONS ================================
    92 
    92 
    93 // -----------------------------------------------------------------------------
    93 // -----------------------------------------------------------------------------
    94 // IsWmDrmFile
    94 // IsWmDrmFile
  2350 void CFileManagerViewBase::DoUpdateProgressBar()
  2350 void CFileManagerViewBase::DoUpdateProgressBar()
  2351     {
  2351     {
  2352     // Update progress indicator
  2352     // Update progress indicator
  2353     if ( iProgressDialog && iProgressInfo )
  2353     if ( iProgressDialog && iProgressInfo )
  2354         {
  2354         {
  2355           iProgressInfo->SetAndDraw( iTotalTransferredBytes/1024 );
  2355           iProgressInfo->SetAndDraw( iTotalTransferredBytes / KMinificationFactor );
  2356         }
  2356         }
  2357     }
  2357     }
  2358 
  2358 
  2359 // ------------------------------------------------------------------------------
  2359 // ------------------------------------------------------------------------------
  2360 // CFileManagerViewBase::UpdateProgressBar
  2360 // CFileManagerViewBase::UpdateProgressBar
  3185     iEngine.GetDriveInfoL(driveNumber,drvInfo);
  3185     iEngine.GetDriveInfoL(driveNumber,drvInfo);
  3186 
  3186 
  3187     // Common remote drive filtering
  3187     // Common remote drive filtering
  3188     RemoteDriveCommonFilteringL( aMenuPane );
  3188     RemoteDriveCommonFilteringL( aMenuPane );
  3189     
  3189     
       
  3190     if ( iContainer->ListBoxNumberOfItems() )
       
  3191         {
       
  3192         if ( !iContainer->ListBoxSelectionIndexesCount() )
       
  3193             {
       
  3194             TUint32 fileType( iEngine.FileTypeL(
       
  3195                 iContainer->ListBoxCurrentItemIndex() ) );
       
  3196             if ( ( fileType & KDefaultFolderMask ) == KDefaultFolderMask )
       
  3197                 {
       
  3198                 aMenuPane.SetItemDimmed( EFileManagerMoveToFolder, ETrue );
       
  3199                 }
       
  3200             }
       
  3201         }
       
  3202     else
       
  3203         {
       
  3204         aMenuPane.SetItemDimmed( EFileManagerMoveToFolder, ETrue );
       
  3205         aMenuPane.SetItemDimmed( EFileManagerCopyToFolder, ETrue );
       
  3206         }
       
  3207     TInt index(iContainer->ListBoxCurrentItemIndex());
       
  3208     TUint32 fileType(iEngine.FileTypeL(index));
       
  3209     if (!(fileType & CFileManagerItemProperties::EFolder))
       
  3210         {
       
  3211         aMenuPane.SetItemDimmed(EFileManagerMoveToFolder, ETrue);
       
  3212         }
  3190     CFileManagerFeatureManager& featureManager( FeatureManager() );
  3213     CFileManagerFeatureManager& featureManager( FeatureManager() );
  3191     
  3214     
  3192 #ifdef RD_MULTIPLE_DRIVE
  3215 #ifdef RD_MULTIPLE_DRIVE
  3193     // No format item for mass storage in embedded mode dimming
  3216     // No format item for mass storage in embedded mode dimming
  3194     if ( !( drvInfo.iState & TFileManagerDriveInfo::EDriveFormattable ) )
  3217     if ( !( drvInfo.iState & TFileManagerDriveInfo::EDriveFormattable ) )
  3476 //
  3499 //
  3477 void CFileManagerViewBase::OrganiseMenuFilteringL( CEikMenuPane& aMenuPane )
  3500 void CFileManagerViewBase::OrganiseMenuFilteringL( CEikMenuPane& aMenuPane )
  3478     {
  3501     {
  3479 //    CEikListBox& listBox( iContainer->ListBox() );
  3502 //    CEikListBox& listBox( iContainer->ListBox() );
  3480 
  3503 
  3481     if ( iContainer->ListBoxNumberOfItems() )
       
  3482         {
       
  3483         if ( !iContainer->ListBoxSelectionIndexesCount() )
       
  3484             {
       
  3485             TUint32 fileType( iEngine.FileTypeL(
       
  3486                 iContainer->ListBoxCurrentItemIndex() ) );
       
  3487             if ( ( fileType & KDefaultFolderMask ) == KDefaultFolderMask )
       
  3488                 {
       
  3489                 aMenuPane.SetItemDimmed( EFileManagerMoveToFolder, ETrue );
       
  3490                 }
       
  3491             }
       
  3492         }
       
  3493     else
       
  3494         {
       
  3495         aMenuPane.SetItemDimmed( EFileManagerMoveToFolder, ETrue );
       
  3496         aMenuPane.SetItemDimmed( EFileManagerCopyToFolder, ETrue );
       
  3497         }
       
  3498 
  3504 
  3499     // Search view item dimming
  3505     // Search view item dimming
  3500     if( iEngine.State() == CFileManagerEngine::ESearch )
  3506     if( iEngine.State() == CFileManagerEngine::ESearch )
  3501         {
  3507         {
  3502         aMenuPane.SetItemDimmed( EFileManagerNewFolder, ETrue );
  3508         aMenuPane.SetItemDimmed( EFileManagerNewFolder, ETrue );
  3505     TFileManagerDriveInfo& drvInfo( DriveInfo() );
  3511     TFileManagerDriveInfo& drvInfo( DriveInfo() );
  3506     if ( drvInfo.iState & TFileManagerDriveInfo::EDriveWriteProtected )
  3512     if ( drvInfo.iState & TFileManagerDriveInfo::EDriveWriteProtected )
  3507         {
  3513         {
  3508         // Write protected item dimming
  3514         // Write protected item dimming
  3509         aMenuPane.SetItemDimmed( EFileManagerNewFolder, ETrue );
  3515         aMenuPane.SetItemDimmed( EFileManagerNewFolder, ETrue );
  3510 		}
  3516 
  3511 
       
  3512 	TInt index(iContainer->ListBoxCurrentItemIndex());
       
  3513 	TUint32 fileType(iEngine.FileTypeL(index));
       
  3514 	if (!(fileType & CFileManagerItemProperties::EFolder))
       
  3515 		{
       
  3516 		aMenuPane.SetItemDimmed(EFileManagerMoveToFolder, ETrue);
       
  3517         }
  3517         }
  3518     }
  3518     }
  3519 
  3519 
  3520 // ------------------------------------------------------------------------------
  3520 // ------------------------------------------------------------------------------
  3521 // CFileManagerViewBase::DetailsMenuFilteringL
  3521 // CFileManagerViewBase::DetailsMenuFilteringL
  4214 
  4214 
  4215     iProgressDialog->SetCallback(this);
  4215     iProgressDialog->SetCallback(this);
  4216     iProgressInfo = iProgressDialog->GetProgressInfoL();
  4216     iProgressInfo = iProgressDialog->GetProgressInfoL();
  4217     if ( iProgressInfo )
  4217     if ( iProgressInfo )
  4218         {
  4218         {
  4219         iProgressInfo->SetFinalValue( static_cast<TInt>( aFinalValue/1024 ) ); 
  4219         iProgressInfo->SetFinalValue( static_cast<TInt>( aFinalValue / KMinificationFactor ) ); 
  4220         iProgressInfo->SetAndDraw( static_cast<TInt>( aInitialValue/1024 ) );
  4220         iProgressInfo->SetAndDraw( static_cast<TInt>( aInitialValue / KMinificationFactor ) );
  4221         }
  4221         }
  4222     iProgressDialog->RunLD();
  4222     iProgressDialog->RunLD();
  4223     }
  4223     }
  4224 
  4224 
  4225 // ------------------------------------------------------------------------------
  4225 // ------------------------------------------------------------------------------
  4768     {
  4768     {
  4769     TBool ret( EFalse );
  4769     TBool ret( EFalse );
  4770     if ( iProgressDialog && iProgressInfo )
  4770     if ( iProgressDialog && iProgressInfo )
  4771         {
  4771         {
  4772         CEikProgressInfo::SInfo info( iProgressInfo->Info() );
  4772         CEikProgressInfo::SInfo info( iProgressInfo->Info() );
  4773         iProgressFinalValue = info.iFinalValue;
  4773         iProgressFinalValue = ( info.iFinalValue ) * KMinificationFactor;
  4774         iProgressCurrentValue = iProgressInfo->CurrentValue();
  4774         iProgressCurrentValue = ( iProgressInfo->CurrentValue() ) * KMinificationFactor;
  4775         if ( !iProgressCurrentValue && iTotalTransferredBytes <= iProgressFinalValue )
  4775         if ( !iProgressCurrentValue && iTotalTransferredBytes <= iProgressFinalValue )
  4776             {
  4776             {
  4777             iProgressCurrentValue = iTotalTransferredBytes;
  4777             iProgressCurrentValue = iTotalTransferredBytes;
  4778             }
  4778             }
  4779         TRAP_IGNORE( iProgressDialog->ProcessFinishedL() );
  4779         TRAP_IGNORE( iProgressDialog->ProcessFinishedL() );