photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp
changeset 3 9a9c174934f5
parent 2 7d9067c6fcb1
child 4 57d388cc48c1
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp	Mon Jan 18 20:19:20 2010 +0200
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp	Tue Jan 26 11:58:28 2010 +0200
@@ -38,16 +38,28 @@
 // -----------------------------------------------------------------------------
 //	
 EXPORT_C CGlxCommandHandlerAiwEdit* CGlxCommandHandlerAiwEdit::NewL(
-        MGlxMediaListProvider* aMediaListProvider, TInt aMenuResource)
+        MGlxMediaListProvider* aMediaListProvider, TInt aMenuResource,
+        TBool aCommandSingleClick)
     {
     CGlxCommandHandlerAiwEdit* self = new ( ELeave ) 
         CGlxCommandHandlerAiwEdit(aMediaListProvider, aMenuResource);
     CleanupStack::PushL( self );
-    self->ConstructL();
+    self->ConstructL(aCommandSingleClick);
     CleanupStack::Pop( self );
     return self;
     }
 
+// ---------------------------------------------------------------------------
+// Symbian 2nd phase constructor can leave.
+// ---------------------------------------------------------------------------
+//
+void CGlxCommandHandlerAiwEdit::ConstructL(TBool aCommandSingleClick)
+    {
+    TRACER("CGlxCommandHandlerAiwEdit::ConstructL");
+    CGlxCommandHandlerAiwBase::ConstructL();
+    iCommandSingleClick = aCommandSingleClick;
+    }
+
 // -----------------------------------------------------------------------------
 // CGlxCommandHandlerAiwEdit::DoGetRequiredAttributesL
 // -----------------------------------------------------------------------------
@@ -79,6 +91,10 @@
 //	
 TInt CGlxCommandHandlerAiwEdit::CommandId() const
     {
+    if (iCommandSingleClick)
+        {
+        return EGlxCmdAiwSingleClickEdit;
+        }
     return EGlxCmdAiwEdit;
     }
     
@@ -97,6 +113,10 @@
 //	
 TInt CGlxCommandHandlerAiwEdit::AiwInterestResource() const
     {
+    if (iCommandSingleClick)
+        {
+        return R_GLX_AIW_SINGLE_CLICK_EDIT_INTEREST;
+        }    
     return R_GLX_AIW_EDIT_INTEREST;
     }
         
@@ -134,11 +154,17 @@
     HBufC* currentTitle = StringLoader::LoadLC( R_QTN_LGAL_OPTIONS_EDIT );
     TInt cmdId = AiwMenuCmdIdL( *currentTitle,aMenuPane ) ;
     CleanupStack::PopAndDestroy(currentTitle);
-    if( KErrNotFound != cmdId )
+
+    if (KErrNotFound != cmdId)
         {
-        if ((MediaList().SelectionCount() > 1))
+        if (iCommandSingleClick && (MediaList().SelectionCount() > 1))
             {
             aMenuPane->SetItemDimmed(cmdId,ETrue);    
             }
+        else if ( MediaList().SelectionCount() != 1) 
+            {
+            // Enable ONLY when a single item marked
+            aMenuPane->SetItemDimmed(cmdId,ETrue);    
+            }    
         }
     }