Revision: 201009 RCL_3
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Mon, 15 Mar 2010 12:39:38 +0200
branchRCL_3
changeset 10 1772663c5b4e
parent 9 8812206c49a0
child 12 60626d494346
Revision: 201009 Kit: 201010
filemanager/App/data/FileManager.rss
filemanager/App/inc/CFileManagerFoldersView.h
filemanager/App/src/CFileManagerBackupView.cpp
filemanager/App/src/CFileManagerFoldersView.cpp
filemanager/App/src/CFileManagerViewBase.cpp
--- a/filemanager/App/data/FileManager.rss	Fri Mar 12 15:41:37 2010 +0200
+++ b/filemanager/App/data/FileManager.rss	Mon Mar 15 12:39:38 2010 +0200
@@ -281,6 +281,18 @@
             },
         MENU_ITEM
             {
+            command = EFileManagerMoveToFolder;
+            txt = qtn_options_org_move_to_folder;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM
+            {
+            command = EFileManagerCopyToFolder;
+            txt = qtn_options_org_copy_to;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM
+            {
             command = EFileManagerMark;
             cascade = r_filemanager_mark_unmark_menu;
             txt = qtn_options_list;
@@ -418,18 +430,6 @@
         {
         MENU_ITEM
             {
-            command = EFileManagerMoveToFolder;
-            txt = qtn_options_org_move_to_folder;
-            flags = EEikMenuItemSpecific;
-            },
-        MENU_ITEM
-            {
-            command = EFileManagerCopyToFolder;
-            txt = qtn_options_org_copy_to;
-            flags = EEikMenuItemSpecific;
-            },
-        MENU_ITEM
-            {
             command = EFileManagerNewFolder;
             txt = qtn_options_org_new_folder;
             }
--- a/filemanager/App/inc/CFileManagerFoldersView.h	Fri Mar 12 15:41:37 2010 +0200
+++ b/filemanager/App/inc/CFileManagerFoldersView.h	Mon Mar 15 12:39:38 2010 +0200
@@ -176,8 +176,6 @@
 
         // Own: For showing info popups
         CAknInfoPopupNoteController* iPopupController;
-        // Own:	Indicate USB storage was removed
-        TBool usbWrongRemoved;
 
     };
 
--- a/filemanager/App/src/CFileManagerBackupView.cpp	Fri Mar 12 15:41:37 2010 +0200
+++ b/filemanager/App/src/CFileManagerBackupView.cpp	Mon Mar 15 12:39:38 2010 +0200
@@ -244,17 +244,21 @@
     StoreIndex();
     CFileManagerBackupSettings& settings( iEngine.BackupSettingsL() );
     TInt drive( settings.TargetDrive() );
-    TInt MemoryCardDriveF( KFmgrMemoryCardDrive + 1 );
-    //KFmgrMemoryCardDrive has been changed as Mass memory,MemoryCard is changed to F
-    
-    if( drive != MemoryCardDriveF && !IsDriveAvailable( drive ) )
-    	{
-    	drive = MemoryCardDriveF;
-    	settings.SetTargetDrive( drive );
-    	settings.SaveL();    	
-    	}
-    TFileManagerDriveInfo drvInfo;
-    iEngine.GetDriveInfoL( drive, drvInfo );
+    TFileManagerDriveInfo drvInfo;    
+    if( !IsDriveAvailable( drive ) )
+        {
+            for( TInt i ( EDriveA ) ; i <= EDriveZ ; i++ )
+                {
+                iEngine.GetDriveInfoL( i , drvInfo );
+                if( ( IsDriveAvailable( i ) ) && ( drvInfo.iState & TFileManagerDriveInfo::EDriveEjectable ) )
+                    {
+                    drive = i;
+                    settings.SetTargetDrive( drive );
+                    settings.SaveL();
+                    break;
+                    }
+                }
+        }
     RArray< CFileManagerRestoreSettings::TInfo > info;
     CleanupClosePushL( info );
     iEngine.GetRestoreInfoArrayL( info, drive );
--- a/filemanager/App/src/CFileManagerFoldersView.cpp	Fri Mar 12 15:41:37 2010 +0200
+++ b/filemanager/App/src/CFileManagerFoldersView.cpp	Mon Mar 15 12:39:38 2010 +0200
@@ -18,10 +18,9 @@
 
 
 // INCLUDE FILES
-#include <StringLoader.h>
-#include <akntitle.h> 
-#include <aknnavi.h> 
-#include <aknnavide.h> 
+#include <akntitle.h>
+#include <aknnavi.h>
+#include <aknnavide.h>
 #include <barsread.h>
 #include <aknlists.h>
 #include <AknsConstants.h>
@@ -257,51 +256,27 @@
             {
             appUi->ExitEmbeddedAppIfNeededL();
             }
-		TInt usb_err(KErrNone);
-			TRAP( usb_err,RefreshDriveInfoL() );
-		if (usb_err != KErrNone)
-			{
-			usbWrongRemoved = ETrue;
-			HBufC* error = StringLoader::LoadLC(R_QTN_SELEC_EMPTY_LIST);
-
-			if (iContainer)
-				{
-				iContainer->ListBoxSetTextL(*error);
-				}
-			CleanupStack::PopAndDestroy(error);
-			}
-		else
-			{
-				TFileManagerDriveInfo& drvInfo( DriveInfo() );
-				if ( !( drvInfo.iState & TFileManagerDriveInfo::EDrivePresent ) )
-				{
-					//User::Leave(KErrPathNotFound);
-					HBufC* error = StringLoader::LoadLC(R_QTN_SELEC_EMPTY_LIST);
-
-					if (iContainer)
-						{
-						iContainer->ListBoxSetTextL(*error);
-						}
-					CleanupStack::PopAndDestroy(error);
-				}
-			else
-				{
-				usbWrongRemoved = EFalse;
-				TInt index( iEngine.CurrentIndex() );
-				if ( index != KErrNotFound )
-					{
-					iContainer->RefreshListL( index );
-					}
-				else
-					{
-					iContainer->RefreshListL( iIndex );
-					}
-        
-				} 			
-			}
-		RefreshTitleL();	
-		iFolderDepth = iEngine.FolderLevel();
-		}
+            TRAP_IGNORE( RefreshDriveInfoL() );
+            TFileManagerDriveInfo& drvInfo( DriveInfo() );
+            if ( !( drvInfo.iState & TFileManagerDriveInfo::EDrivePresent ) )
+                {
+                User::Leave(KErrPathNotFound);
+                }
+            else
+                {
+                TInt index( iEngine.CurrentIndex() );
+                if ( index != KErrNotFound )
+                    {
+                    iContainer->RefreshListL( index );
+                    }
+                else
+                    {
+                    iContainer->RefreshListL( iIndex );
+                    }
+                RefreshTitleL();
+                }
+        iFolderDepth = iEngine.FolderLevel();
+        }
     }
 
 // -----------------------------------------------------------------------------
@@ -335,28 +310,13 @@
 void CFileManagerFoldersView::BackstepL(
        TInt aBacksteps )
     {
-	
-
-	
-	if ( usbWrongRemoved )
-		{
-		CFileManagerAppUi* appUi = static_cast<CFileManagerAppUi*> (AppUi());	 
-		usbWrongRemoved = EFalse;
-		iFolderDepth = 0;
-		iIndex = 0;
-		appUi->CloseFoldersViewL();
-		}
-	else
-		{
-		if (iActiveProcess != ENoProcess)
-				{
-				return; // Ignore to avoid container mess up
-				}
-
-			iPopupController->HideInfoPopupNote();
-			CFileManagerAppUi* appUi = static_cast<CFileManagerAppUi*> (AppUi());
-			TInt level(iEngine.FolderLevel());
-
+    if (iActiveProcess != ENoProcess)
+        {
+        return; // Ignore to avoid container mess up
+        }
+    iPopupController->HideInfoPopupNote();
+    CFileManagerAppUi* appUi = static_cast<CFileManagerAppUi*> (AppUi());
+    TInt level(iEngine.FolderLevel());
     while ( aBacksteps > 0 )
         {
         if ( level < iInitialFolderDepth )
@@ -373,19 +333,18 @@
         appUi->ExitEmbeddedAppIfNeededL();
         }
 
-		if (level < iInitialFolderDepth)
-			{
-			iFolderDepth = 0;
-			iIndex = 0;
-			appUi->CloseFoldersViewL();
-			}
-		else
-			{
-			iEngine.SetObserver(this);
-			iEngine.RefreshDirectory();
-			}
-		}
-	}
+    if (level < iInitialFolderDepth)
+        {
+        iFolderDepth = 0;
+        iIndex = 0;
+        appUi->CloseFoldersViewL();
+        }
+    else
+        {
+        iEngine.SetObserver(this);
+        iEngine.RefreshDirectory();
+        }
+    }
 
 // ------------------------------------------------------------------------------
 // CFileManagerFoldersView::FolderName
--- a/filemanager/App/src/CFileManagerViewBase.cpp	Fri Mar 12 15:41:37 2010 +0200
+++ b/filemanager/App/src/CFileManagerViewBase.cpp	Mon Mar 15 12:39:38 2010 +0200
@@ -86,7 +86,7 @@
 const TInt64 KMinToMicroSecMultiplier = KMSecToMicroSecMultiplier * 60;
 const TInt64 KHourToMicroSecMultiplier = KMinToMicroSecMultiplier * 60;
 const TUint KProgressBarAsyncStartDelay = 1500000; // microseconds
-
+const TInt KMinificationFactor = 1024; // Used to zoom processbar's proportion
 
 // ============================ LOCAL FUNCTIONS ================================
 
@@ -2352,7 +2352,7 @@
     // Update progress indicator
     if ( iProgressDialog && iProgressInfo )
         {
-          iProgressInfo->SetAndDraw( iTotalTransferredBytes/1024 );
+          iProgressInfo->SetAndDraw( iTotalTransferredBytes / KMinificationFactor );
         }
     }
 
@@ -3187,6 +3187,29 @@
     // Common remote drive filtering
     RemoteDriveCommonFilteringL( aMenuPane );
     
+    if ( iContainer->ListBoxNumberOfItems() )
+        {
+        if ( !iContainer->ListBoxSelectionIndexesCount() )
+            {
+            TUint32 fileType( iEngine.FileTypeL(
+                iContainer->ListBoxCurrentItemIndex() ) );
+            if ( ( fileType & KDefaultFolderMask ) == KDefaultFolderMask )
+                {
+                aMenuPane.SetItemDimmed( EFileManagerMoveToFolder, ETrue );
+                }
+            }
+        }
+    else
+        {
+        aMenuPane.SetItemDimmed( EFileManagerMoveToFolder, ETrue );
+        aMenuPane.SetItemDimmed( EFileManagerCopyToFolder, ETrue );
+        }
+    TInt index(iContainer->ListBoxCurrentItemIndex());
+    TUint32 fileType(iEngine.FileTypeL(index));
+    if (!(fileType & CFileManagerItemProperties::EFolder))
+        {
+        aMenuPane.SetItemDimmed(EFileManagerMoveToFolder, ETrue);
+        }
     CFileManagerFeatureManager& featureManager( FeatureManager() );
     
 #ifdef RD_MULTIPLE_DRIVE
@@ -3478,23 +3501,6 @@
     {
 //    CEikListBox& listBox( iContainer->ListBox() );
 
-    if ( iContainer->ListBoxNumberOfItems() )
-        {
-        if ( !iContainer->ListBoxSelectionIndexesCount() )
-            {
-            TUint32 fileType( iEngine.FileTypeL(
-                iContainer->ListBoxCurrentItemIndex() ) );
-            if ( ( fileType & KDefaultFolderMask ) == KDefaultFolderMask )
-                {
-                aMenuPane.SetItemDimmed( EFileManagerMoveToFolder, ETrue );
-                }
-            }
-        }
-    else
-        {
-        aMenuPane.SetItemDimmed( EFileManagerMoveToFolder, ETrue );
-        aMenuPane.SetItemDimmed( EFileManagerCopyToFolder, ETrue );
-        }
 
     // Search view item dimming
     if( iEngine.State() == CFileManagerEngine::ESearch )
@@ -3507,13 +3513,7 @@
         {
         // Write protected item dimming
         aMenuPane.SetItemDimmed( EFileManagerNewFolder, ETrue );
-		}
-
-	TInt index(iContainer->ListBoxCurrentItemIndex());
-	TUint32 fileType(iEngine.FileTypeL(index));
-	if (!(fileType & CFileManagerItemProperties::EFolder))
-		{
-		aMenuPane.SetItemDimmed(EFileManagerMoveToFolder, ETrue);
+
         }
     }
 
@@ -4216,8 +4216,8 @@
     iProgressInfo = iProgressDialog->GetProgressInfoL();
     if ( iProgressInfo )
         {
-        iProgressInfo->SetFinalValue( static_cast<TInt>( aFinalValue/1024 ) ); 
-        iProgressInfo->SetAndDraw( static_cast<TInt>( aInitialValue/1024 ) );
+        iProgressInfo->SetFinalValue( static_cast<TInt>( aFinalValue / KMinificationFactor ) ); 
+        iProgressInfo->SetAndDraw( static_cast<TInt>( aInitialValue / KMinificationFactor ) );
         }
     iProgressDialog->RunLD();
     }
@@ -4770,8 +4770,8 @@
     if ( iProgressDialog && iProgressInfo )
         {
         CEikProgressInfo::SInfo info( iProgressInfo->Info() );
-        iProgressFinalValue = info.iFinalValue;
-        iProgressCurrentValue = iProgressInfo->CurrentValue();
+        iProgressFinalValue = ( info.iFinalValue ) * KMinificationFactor;
+        iProgressCurrentValue = ( iProgressInfo->CurrentValue() ) * KMinificationFactor;
         if ( !iProgressCurrentValue && iTotalTransferredBytes <= iProgressFinalValue )
             {
             iProgressCurrentValue = iTotalTransferredBytes;