photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlersend.cpp
changeset 3 9a9c174934f5
parent 0 4e91876724a2
child 13 71da52165949
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlersend.cpp	Mon Jan 18 20:19:20 2010 +0200
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandlersend.cpp	Tue Jan 26 11:58:28 2010 +0200
@@ -101,6 +101,11 @@
     info.iMinSelectionLength = 1;
     info.iMaxSelectionLength = KMaxTInt;
    	AddCommandL(info);
+	
+   	TCommandInfo singleclickinfo(EGlxCmdSingleClickSend);
+   	singleclickinfo.iMinSelectionLength = 1;
+   	singleclickinfo.iMaxSelectionLength = KMaxTInt;
+    AddCommandL(singleclickinfo);
 	}	
 	
 
@@ -132,7 +137,7 @@
 	{
     GLX_FUNC("CGlxCommandHandlerSend::DoExecuteL");
 	
-    if (aCommandId == EGlxCmdSend)
+    if (aCommandId == EGlxCmdSend || aCommandId == EGlxCmdSingleClickSend)
         {
         SendSelectedItemsL();
         return ETrue;
@@ -393,4 +398,26 @@
 	
 	iUiUtility->ScreenFurniture()->SetTooltipL( EGlxCmdSend, CAknButton::EPositionLeft );
 	}
+
+// ----------------------------------------------------------------------------
+// DoIsDisabled
+// ----------------------------------------------------------------------------
+//	
+TBool CGlxCommandHandlerSend::DoIsDisabled(TInt aCommandId, 
+                                           MGlxMediaList& aList) const
+    {
+    GLX_FUNC("CGlxCommandHandlerSend::DoIsDisabled");
+    if ( (EGlxCmdSingleClickSend == aCommandId || EGlxCmdSend==aCommandId) &&
+         aList.SelectionCount() )
+        {
+        return EFalse;
+        }
+    
+    if (EGlxCmdSend == aCommandId && aList.Count())
+        {
+        return EFalse;
+        }
+    
+    return ETrue;
+    }
 // End of file