Revision: 201003 RCL_3 PDK_3.0.h
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 19 Feb 2010 22:41:53 +0200
branchRCL_3
changeset 5 1e73d2d04cbc
parent 1 d1daf54a55b5
child 7 8812206c49a0
Revision: 201003 Kit: 201007
deviceencryption/DevEncGsPlugin/src/devencgsplugin.cpp
deviceencryption/DevEncUi/src/DevEncUiEncryptionOperator.cpp
filemanager/App/data/FileManager.rss
filemanager/App/src/CFileManagerAppUi.cpp
filemanager/App/src/CFileManagerFileListContainer.cpp
filemanager/App/src/CFileManagerViewBase.cpp
filemanager/Engine/src/CFileManagerActiveExecute.cpp
filemanager/Engine/src/CFileManagerRemovableDriveHandler.cpp
filemanager/Engine/src/CFileManagerUtils.cpp
--- a/deviceencryption/DevEncGsPlugin/src/devencgsplugin.cpp	Tue Feb 02 00:03:31 2010 +0200
+++ b/deviceencryption/DevEncGsPlugin/src/devencgsplugin.cpp	Fri Feb 19 22:41:53 2010 +0200
@@ -18,12 +18,12 @@
 
 // User includes
 #include    "devencgsplugin.h"
-#include    <GSParentPlugin.h>
-#include    <GSCommon.hrh>
+#include    <gsparentplugin.h>
+#include    <gscommon.hrh>
 #include    <devencgspluginrsc.rsg> // GUI Resource
 //#include    <DevEncUi.rsg>
 #include    <devencgsplugin.mbg>
-#include    <GSPrivatePluginProviderIds.h>
+#include    <gsprivatepluginproviderids.h>
 #include    <hwrmvibrasdkcrkeys.h>
 #include    <AknLaunchAppService.h>
 #include    <AiwCommon.h>
--- a/deviceencryption/DevEncUi/src/DevEncUiEncryptionOperator.cpp	Tue Feb 02 00:03:31 2010 +0200
+++ b/deviceencryption/DevEncUi/src/DevEncUiEncryptionOperator.cpp	Fri Feb 19 22:41:53 2010 +0200
@@ -40,8 +40,8 @@
 #include <f32file.h>
 #include <gsfwviewuids.h> // For general settings view UIDs (autolock)
 #include <hwrmpowerstatesdkpskeys.h> // For power state
-#include <SecUiSecuritySettings.h> // for autolock
-#include <SettingsInternalCRKeys.h>
+#include <secuisecuritysettings.h> // for autolock
+#include <settingsinternalcrkeys.h>
 #include <StringLoader.h>
 #include <utf.h> // For character conversion
 #include <TerminalControl3rdPartyAPI.h>
--- a/filemanager/App/data/FileManager.rss	Tue Feb 02 00:03:31 2010 +0200
+++ b/filemanager/App/data/FileManager.rss	Fri Feb 19 22:41:53 2010 +0200
@@ -179,16 +179,19 @@
             {
             command = EFileManagerConnectRemoveDrive;
             txt = qtn_rd_opt_connect;
+            flags = EEikMenuItemDimmed;
             },
         MENU_ITEM 
             {
             command = EFileManagerDisconnectRemoveDrive;
             txt = qtn_rd_opt_disconnect;
+            flags = EEikMenuItemDimmed;
             },
         MENU_ITEM 
             {
             command = EFileManagerEject;
             txt = qtn_fmgr_options_eject;
+            flags = EEikMenuItemSpecific;
             },
 #ifndef RD_FILE_MANAGER_BACKUP
         MENU_ITEM 
@@ -202,27 +205,32 @@
             txt = qtn_memc_options_restore;
             },
 #endif // !RD_FILE_MANAGER_BACKUP
-		MENU_ITEM
-			{
-			command = EFileManagerFindFile;
-			txt = qtn_fmgr_options_find_file;
-			},
-		MENU_ITEM
-			{
-			command = EFileManagerMemoryStorage;
-			cascade = r_filemanager_memory_storage_menu;
-			txt = qtn_fmgr_options_memory_sub;
-			flags = EEikMenuItemSpecific;
-			},
-		MENU_ITEM
-			{
-			command = EFileManagerRemoveDrives;
-			cascade = r_filemanager_remote_drives_menu;
-			txt = qtn_fmgr_opt_remote_drives;
-			flags = EEikMenuItemSpecific;
-			},
-		MENU_ITEM
-			{
+        MENU_ITEM
+            {
+            command = EFileManagerFindFile;
+            txt = qtn_fmgr_options_find_file;
+            },
+        MENU_ITEM
+            {
+            command = EFileManagerMemoryStorage;
+            cascade = r_filemanager_memory_storage_menu;
+            txt = qtn_fmgr_options_memory_sub;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM
+            {
+            command = EFileManagerRemoveDrives;
+            cascade = r_filemanager_remote_drives_menu;
+            txt = qtn_fmgr_opt_remote_drives;
+            flags = EEikMenuItemSpecific;
+            },
+        MENU_ITEM
+            {
+            command = EFileManagerRemoveDrivesMapDrive;
+            txt = qtn_fmgr_opt_rd_new_drive;
+            },
+        MENU_ITEM
+            {
             command = EAknCmdHelp;
             txt = qtn_options_help;
             },
@@ -248,19 +256,16 @@
             {
             command = EFileManagerConnectRemoveDrive;
             txt = qtn_rd_opt_connect;
-            flags = EEikMenuItemSpecific;
             },
         MENU_ITEM 
             {
             command = EFileManagerDisconnectRemoveDrive;
             txt = qtn_rd_opt_disconnect;
-            flags = EEikMenuItemSpecific;
             },
         MENU_ITEM 
             {
             command = EFileManagerRefreshRemoteDrive;
             txt = qtn_fmgr_rd_opt_refresh;
-            flags = EEikMenuItemSpecific;
             },
         MENU_ITEM
             {
@@ -511,12 +516,6 @@
             },
         MENU_ITEM
             {
-            command = EFileManagerRemoveDrivesMapDrive;
-            txt = qtn_fmgr_opt_rd_new_drive;
-            flags = EEikMenuItemSpecific;
-            },
-        MENU_ITEM
-            {
             command = EFileManagerRemoveDrivesDelete;
             txt = qtn_fmgr_opt_rd_delete_drive;
             flags = EEikMenuItemSpecific;
--- a/filemanager/App/src/CFileManagerAppUi.cpp	Tue Feb 02 00:03:31 2010 +0200
+++ b/filemanager/App/src/CFileManagerAppUi.cpp	Fri Feb 19 22:41:53 2010 +0200
@@ -22,7 +22,7 @@
 #include <aknnavi.h>    // CAknNavigationControlContainer 
 #include <aknnavide.h>  // CAknNavigationDecorator
 #include <sendui.h>     // CSendAppUi
-#include <sendnorm.rsg>
+#include <Sendnorm.rsg>
 #include <avkon.rsg>
 #include <barsread.h>
 #include <hlplch.h>     // HlpLauncher
--- a/filemanager/App/src/CFileManagerFileListContainer.cpp	Tue Feb 02 00:03:31 2010 +0200
+++ b/filemanager/App/src/CFileManagerFileListContainer.cpp	Fri Feb 19 22:41:53 2010 +0200
@@ -32,8 +32,9 @@
 #include "CFileManagerAppUi.h"
 #include "FileManager.hrh"
 #include "CFileManagerIconArray.h"
-
-
+#include <aknview.h>
+#include <eikmenub.h>
+#include <eikmenup.h> // CEikMenuPane
 // CONSTANTS
 const TInt KTouchGestureThreshold = 30; // Threshold could be stored in CenRep
 
@@ -199,27 +200,38 @@
         const TKeyEvent& aKeyEvent, TEventCode aType )
     {
     TKeyResponse response = OfferSearchKeyEventL( aKeyEvent, aType );
+    if ( response == EKeyWasConsumed )
+       {
+       return response;
+       }   
     
-    response = ListBox().OfferKeyEventL( aKeyEvent, aType );
-   /* if ( response == EKeyWasConsumed )
-            {
-            return response;
-            }*/
+    TVwsViewId enabledViewId = TVwsViewId( KNullUid, KNullUid );
+    iAppUi->GetActiveViewId( enabledViewId );
+             
+    TUid enabledViewUid = enabledViewId.iViewUid;
+    CAknView* enabledView = iAppUi->View( enabledViewUid );
+    CEikMenuBar* menuBar = enabledView->MenuBar();
+    
     switch( aKeyEvent.iCode )
         {
         case EKeyEnter: // FALLTHROUH
         case EKeyOK:
             {
-          /*  indexOfMSK++;
-            iAppUi->ProcessCommandL( EFileManagerSelectionKey );
-            response = EKeyWasConsumed;*/
+            if ( menuBar->ItemSpecificCommandsEnabled() )
+                {
+                iAppUi->ProcessCommandL( EFileManagerSelectionKey );
+                response = EKeyWasConsumed;
+                }
             break;
             }
         case EKeyDelete:    // FALLTHROUGH
         case EKeyBackspace:
             {
-            iAppUi->ProcessCommandL( EFileManagerDelete );
-            response = EKeyWasConsumed;
+            if ( menuBar->ItemSpecificCommandsEnabled() )
+                {
+                iAppUi->ProcessCommandL( EFileManagerDelete );
+                response = EKeyWasConsumed;
+                }
             break;
             }
         case EKeyLeftArrow: // FALLTHROUGH
@@ -254,7 +266,7 @@
             }
         default:
             {
-         //   response = ListBox().OfferKeyEventL( aKeyEvent, aType );
+            response = ListBox().OfferKeyEventL( aKeyEvent, aType );
             break;
             }
         }
--- a/filemanager/App/src/CFileManagerViewBase.cpp	Tue Feb 02 00:03:31 2010 +0200
+++ b/filemanager/App/src/CFileManagerViewBase.cpp	Fri Feb 19 22:41:53 2010 +0200
@@ -26,7 +26,7 @@
 #include <CAknMemorySelectionDialog.h>
 #include <CAknFileSelectionDialog.h>
 #include <sendui.h>
-#include <sendnorm.rsg>
+#include <Sendnorm.rsg>
 #include <SenduiMtmUids.h>
 #include <AknProgressDialog.h>
 #include <eikprogi.h>
@@ -586,20 +586,22 @@
 void CFileManagerViewBase::MarkMenuFilteringL( CEikMenuPane& aMenuPane )
     {
     TInt index( iContainer->ListBoxCurrentItemIndex() );
-    if ( iContainer->ListBoxIsItemSelected( index ) )
-        {
-        aMenuPane.SetItemDimmed( EFileManagerMarkOne, ETrue );
-        }
-    else
-        {
-        aMenuPane.SetItemDimmed( EFileManagerUnmarkOne, ETrue );
-        }
 
     if ( iEngine.IsFolder( index ) )
         {
         aMenuPane.SetItemDimmed( EFileManagerMarkOne, ETrue );
         aMenuPane.SetItemDimmed( EFileManagerUnmarkOne, ETrue );
-        aMenuPane.SetItemDimmed( EFileManagerMarkAll, ETrue );
+        }
+    else
+        {
+        if ( iContainer->ListBoxIsItemSelected( index ) )
+            {
+            aMenuPane.SetItemDimmed( EFileManagerMarkOne, ETrue );
+            }
+        else
+            {
+            aMenuPane.SetItemDimmed( EFileManagerUnmarkOne, ETrue );
+            }
         }
 
     TInt files( iEngine.FilesInFolderL() );
@@ -613,7 +615,6 @@
         {
         aMenuPane.SetItemDimmed( EFileManagerUnmarkAll, ETrue );
         }
-
     }
 
 // -----------------------------------------------------------------------------
@@ -3341,6 +3342,14 @@
         }
     else if ( iContainer->ListBoxNumberOfItems() )
         {
+        // Check if there is files on the list
+        TInt files( iEngine.FilesInFolderL() );
+        if ( !files ) 
+            {
+            dimSend = ETrue;
+            aMenuPane.SetItemDimmed( EFileManagerMark, ETrue );
+            }
+        
         // There is items in list, check selection type
         TUint32 fileType( iEngine.FileTypeL(
             iContainer->ListBoxCurrentItemIndex() ) );
@@ -3348,13 +3357,11 @@
             {
             dimSend = ETrue;
             aMenuPane.SetItemDimmed( EFileManagerDelete, ETrue );
-            aMenuPane.SetItemDimmed( EFileManagerMark, ETrue );
             aMenuPane.SetItemDimmed( EFileManagerRename, ETrue );
             }
         else if ( fileType & CFileManagerItemProperties::EFolder )
             {
             dimSend = ETrue;
-            aMenuPane.SetItemDimmed( EFileManagerMark, ETrue );
             }
 
         if ( fileType & CFileManagerItemProperties::EPlaylist )
--- a/filemanager/Engine/src/CFileManagerActiveExecute.cpp	Tue Feb 02 00:03:31 2010 +0200
+++ b/filemanager/Engine/src/CFileManagerActiveExecute.cpp	Fri Feb 19 22:41:53 2010 +0200
@@ -114,7 +114,7 @@
         iItemIterator->CurrentL( &iSrc, &iDst, iItemType );
         }
 
-    if ( ( iDst && iDst->Length() > KMaxFileName ) || !iDst )
+    if ( iDst && iDst->Length() > KMaxFileName )
         {
         error = KErrBadName;
         TRequestStatus* status = &iStatus;
--- a/filemanager/Engine/src/CFileManagerRemovableDriveHandler.cpp	Tue Feb 02 00:03:31 2010 +0200
+++ b/filemanager/Engine/src/CFileManagerRemovableDriveHandler.cpp	Fri Feb 19 22:41:53 2010 +0200
@@ -920,74 +920,40 @@
 // 
 void CFileManagerRemovableDriveHandler::StartFormatProcessL()
     {
-    RDebug::Printf(">> CFileManagerRemovableDriveHandler::StartFormatProcessL() 1 ");
     // Store the current volume name over format operation.
     TRAPD( err, StoreVolumeNameL( iDrive ) );
     LOG_IF_ERROR1(
         err,
         "FileManagerRemovableDriveHandler::StartFormatProcessL-StoreVolumeName %d",
         err );
-
     TDriveName driveName( TDriveUnit( iDrive ).Name() );
-    RDebug::Printf(">> CFileManagerRemovableDriveHandler::StartFormatProcessL() 2");
     // Resolve drive character and open formatter
     iFormatter.Close();
-    RDebug::Printf(">> CFileManagerRemovableDriveHandler::StartFormatProcessL() 2.1");
     err = iFormatter.Open(
         iFs, driveName, EFullFormat, iFinalValue );
-    RDebug::Printf(">> CFileManagerRemovableDriveHandler::StartFormatProcessL() 2.2 RFormat::Open full err=%d", err);
-
     // Forced format for locked card
     if ( err == KErrLocked )
         {
         // Erase password and try again
         err = iFs.ErasePassword( iDrive );
-        INFO_LOG1( "FileManagerRemovableDriveHandler::StartFormatProcessL-ErasePassword result=%d", err);
-
         if (err == KErrNone)
         	{
-        	err = iFormatter.Open(iFs, driveName, EFullFormat , iFinalValue );
-        	RDebug::Printf(">> CFileManagerRemovableDriveHandler::StartFormatProcessL() RFormat::Open again err=%d", err);
+        	err = iFormatter.Open(iFs, driveName, EFullFormat , iFinalValue );        
         	}
         }
-
     if (err == KErrInUse)
-    	{
-    	RDebug::Printf(">> CFileManagerRemovableDriveHandler::StartFormatProcessL KErrInUse try force format err=%d", err);
-
-    	// There are still files open on the drive being formatted, prompt the user to
-    	// ask if they want to format anyway.
-    	//
-    	// formatting.
-    	//TBool reallyFormat = FileManagerDlgUtils::ShowConfirmQueryWithYesNoL(_L("There are files open on this drive, continue with format?"));
-    	TBool reallyFormat = ETrue; // TEMP! - should ask the user to confirm Yes / No
-
+    	{    
+    	TBool reallyFormat = ETrue;
     	if (reallyFormat)
-    		{
-    		// Open the RFormat sub-session with force format flags
-    		RDebug::Printf( "FileManagerRemovableDriveHandler::StartFormatProcessL-******force format*****");
+    		{    	
     		err = iFormatter.Open(
-    				iFs, driveName, EFullFormat | EForceFormat, iFinalValue );
-    		RDebug::Printf( "FileManagerRemovableDriveHandler::StartFormatProcessL-******force format***** err = %d", err);
+    				iFs, driveName, EFullFormat | EForceFormat, iFinalValue );    		
     		}
     	}
-
-    // By the time we get here, one of three things could have happened:
-    // 1.  	RFormat has been opened with standard full format flag with no error
-    // 2.  	Some other app still has files opened so full format cannot be used.
-    //		A second attempt has been made to open the format sub-session with
-    //		full format flags and this has succeeded.
-    // 3.	As 2 but for some other reason (corrupt card perhaps?), force format
-    // 		does not work in which case abort format.
-
-
    TFullName fsName;
    if (err == KErrNone)
 	   {
-	   err = iFs.FileSystemName( fsName, iDrive );
-
-	   RDebug::Printf( "FileManagerRemovableDriveHandler::StartFormatProcessL-fsName=%S, result=%d",
-			   &fsName, err );
+	   err = iFs.FileSystemName( fsName, iDrive );			  
 
 	   if ( err == KErrNone && fsName.Length() > 0 )
 		   {
@@ -1012,20 +978,16 @@
         {
         TRAP( err, InformStartL( iFinalValue ) );
         if ( err == KErrNone )
-            {
-            RDebug::Printf(">> CFileManagerRemovableDriveHandler::StartFormatProcessL() RFormat::Next err = %d, tracks left=%d", err, iFinalValue);
+            {           
             iFormatCountBuf = iFinalValue;
             iFormatter.Next( iFormatCountBuf, iStatus );
             SetActive();
             }
         }
     if ( !iFinalValue || err != KErrNone )
-        {
-        RDebug::Printf(">> CFileManagerRemovableDriveHandler::StartFormatProcessL() 6 err = %d", err);
-        EndFormatProcessL( err );
-        RDebug::Printf(">> CFileManagerRemovableDriveHandler::StartFormatProcessL() 7 err = %d", err);
+        {   
+        EndFormatProcessL( err );     
         }
-    RDebug::Printf("<< CFileManagerRemovableDriveHandler::StartFormatProcessL() 8 err=%d", err);
     }
 // ---------------------------------------------------------------------------
 // CFileManagerRemovableDriveHandler::CloseAppsL
--- a/filemanager/Engine/src/CFileManagerUtils.cpp	Tue Feb 02 00:03:31 2010 +0200
+++ b/filemanager/Engine/src/CFileManagerUtils.cpp	Fri Feb 19 22:41:53 2010 +0200
@@ -226,18 +226,17 @@
    
     RFile64 drmFile;
     
-       User::LeaveIfError( drmFile.Open( 
-               iFs, aFullPath, EFileRead | EFileShareReadersOrWriters ) );
-       CleanupClosePushL( drmFile );
-       DRM::CDrmUtility *drmCheck = DRM::CDrmUtility::NewLC();
+    User::LeaveIfError( drmFile.Open( 
+        iFs, aFullPath, EFileRead | EFileShareReadersOrWriters ) );
+    CleanupClosePushL( drmFile );
+    DRM::CDrmUtility *drmCheck = DRM::CDrmUtility::NewLC();
        
-       TBool isProtected( EFalse );
-       if ( drmCheck->IsProtectedL(drmFile) )
-    	   {
-    	              isProtected = ETrue;
-    	   }
-       CleanupStack::PopAndDestroy(drmCheck);
-       CleanupStack::PopAndDestroy( &drmFile );
+    TBool isProtected( EFalse );        
+    TRAP_IGNORE( isProtected = drmCheck->IsProtectedL( drmFile ) ); 
+    
+    CleanupStack::PopAndDestroy( drmCheck );
+    CleanupStack::PopAndDestroy( &drmFile );
+       
     return isProtected;
 #endif
     }