photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraddtocontainer.cpp
branchRCL_3
changeset 47 f9e827349359
parent 35 420f6808bf21
equal deleted inserted replaced
35:420f6808bf21 47:f9e827349359
   174 	if(iIsProcessOngoing)
   174 	if(iIsProcessOngoing)
   175 	    {
   175 	    {
   176 	    return NULL;
   176 	    return NULL;
   177 	    }
   177 	    }
   178     iSelectionCount = 0;
   178     iSelectionCount = 0;
       
   179     iItemsSelectionCount = 0;
   179 	// Set the Flag inorder to block any new subsequent selection pop-ups from getting created.
   180 	// Set the Flag inorder to block any new subsequent selection pop-ups from getting created.
   180 	iIsProcessOngoing = ETrue;
   181 	iIsProcessOngoing = ETrue;
   181     CMPXCollectionPath* targetCollection = CMPXCollectionPath::NewL();
   182     CMPXCollectionPath* targetCollection = CMPXCollectionPath::NewL();
   182     CleanupStack::PushL(targetCollection);
   183     CleanupStack::PushL(targetCollection);
   183     TBool enableMultipleSelection = EFalse;
   184     TBool enableMultipleSelection = EFalse;
   224         if (accepted)
   225         if (accepted)
   225             {        
   226             {        
   226             // Set the container selection count to give correct completion text
   227             // Set the container selection count to give correct completion text
   227             TArray<TInt> selection = targetContainers->Selection();
   228             TArray<TInt> selection = targetContainers->Selection();
   228             iSelectionCount = selection.Count();
   229             iSelectionCount = selection.Count();
       
   230             iItemsSelectionCount = sourceItems->Count();
   229             
   231             
   230             CleanupStack::PushL(targetContainers);
   232             CleanupStack::PushL(targetContainers);
   231             command = TGlxCommandFactory::AddToContainerCommandLC(
   233             command = TGlxCommandFactory::AddToContainerCommandLC(
   232                 *sourceItems, *targetContainers);
   234                 *sourceItems, *targetContainers);
   233             CleanupStack::Pop(command); 
   235             CleanupStack::Pop(command); 
   261 HBufC* CGlxCommandHandlerAddToContainer::CompletionTextL() const
   263 HBufC* CGlxCommandHandlerAddToContainer::CompletionTextL() const
   262     {
   264     {
   263     TRACER("CGlxCommandHandlerAddToContainer::CompletionTextL()");
   265     TRACER("CGlxCommandHandlerAddToContainer::CompletionTextL()");
   264     if (iCommandId == EGlxCmdAddToAlbum)
   266     if (iCommandId == EGlxCmdAddToAlbum)
   265     	{
   267     	{
   266    		if (iSelectionCount > 1)
   268    		if (iItemsSelectionCount > 1)
   267    			{
   269    			{
   268 	   		return StringLoader::LoadL(R_GLX_COMPLETION_ADD_TO_CONTAINER_MULTI_ITEM_ALBUM);
   270 	   		return StringLoader::LoadL(R_GLX_COMPLETION_ADD_TO_CONTAINER_MULTI_ITEM_ALBUM);
   269    			}
   271    			}
   270    		return StringLoader::LoadL(R_GLX_COMPLETION_ADD_TO_CONTAINER_ONE_ITEM_ALBUM);
   272    		return StringLoader::LoadL(R_GLX_COMPLETION_ADD_TO_CONTAINER_ONE_ITEM_ALBUM);
   271     	}
   273     	}
   332 // ---------------------------------------------------------------------------
   334 // ---------------------------------------------------------------------------
   333 // CGlxCommandHandlerAddToContainer::DoIsDisabled
   335 // CGlxCommandHandlerAddToContainer::DoIsDisabled
   334 // ---------------------------------------------------------------------------
   336 // ---------------------------------------------------------------------------
   335 //
   337 //
   336 TBool CGlxCommandHandlerAddToContainer::DoIsDisabled(TInt aCommandId, 
   338 TBool CGlxCommandHandlerAddToContainer::DoIsDisabled(TInt aCommandId, 
   337                                                  MGlxMediaList& aList) const
   339                                                  MGlxMediaList& /*aList*/) const
   338     {
   340     {
   339 	TRACER("CGlxCommandHandlerAddToContainer::DoIsDisabled");
   341 	TRACER("CGlxCommandHandlerAddToContainer::DoIsDisabled");
   340 	if (EGlxCmdAddToAlbum==aCommandId || EGlxCmdAddTag == aCommandId)
   342 	if (EGlxCmdAddToAlbum==aCommandId || EGlxCmdAddTag == aCommandId)
   341         {
   343         {
   342         return EFalse;
   344         return EFalse;