photosgallery/viewframework/views/viewbase/src/glxtoolbarcontroller.cpp
branchRCL_3
changeset 13 bcb43dc84c44
parent 0 4e91876724a2
child 14 2dac0fdba72b
equal deleted inserted replaced
12:ce1c7ad1f18b 13:bcb43dc84c44
   201     // If atleast 1 item is marked, or if Mark All is called, then Latch the mark button.
   201     // If atleast 1 item is marked, or if Mark All is called, then Latch the mark button.
   202     if((aList->SelectionCount() == 1 ) || (aList->SelectionCount() == aList->Count()))
   202     if((aList->SelectionCount() == 1 ) || (aList->SelectionCount() == aList->Count()))
   203         {
   203         {
   204         EnableLatch( EGlxCmdStartMultipleMarking, ETrue );
   204         EnableLatch( EGlxCmdStartMultipleMarking, ETrue );
   205         }
   205         }
   206 	/* single clk chngs
       
   207 	 * check the current view status.
       
   208 	 * need to disable upload button in toolbar for grid by default
       
   209 	 */
       
   210 	if(!IsFullScreenView())
       
   211         {
       
   212         if(aList->SelectionCount() >= 1 )
       
   213             {
       
   214             iToolbar->SetItemDimmed(EGlxCmdUpload,EFalse , ETrue);
       
   215             }
       
   216         else
       
   217             {
       
   218             iToolbar->SetItemDimmed(EGlxCmdUpload,ETrue , ETrue);
       
   219             }    
       
   220         }
       
   221     
       
   222     //DrawNow must be called since SetDimmed does not redraw the toolbar
       
   223     iToolbar->DrawNow();    
       
   224     }
   206     }
   225 
   207 
   226 //----------------------------------------------------------------------------
   208 //----------------------------------------------------------------------------
   227 // HandleMessageL
   209 // HandleMessageL
   228 //----------------------------------------------------------------------------
   210 //----------------------------------------------------------------------------
   291 		else
   273 		else
   292 			{
   274 			{
   293 			iToolbar->SetItemDimmed( EGlxCmdRename, EFalse, ETrue );
   275 			iToolbar->SetItemDimmed( EGlxCmdRename, EFalse, ETrue );
   294 			}    
   276 			}    
   295 		}    
   277 		}    
   296 	/* single clk chngs
       
   297 	 * enable/disable upload button as per selection count, only in grid view
       
   298 	 */
       
   299 	if(aList->SelectionCount()== 0 && !IsFullScreenView())
       
   300 	    {
       
   301 	    iToolbar->SetItemDimmed(EGlxCmdUpload,ETrue , ETrue);
       
   302 	    }
       
   303 	
   278 	
   304 	//DrawNow must be called since SetDimmed does not redraw the toolbar
   279 	//DrawNow must be called since SetDimmed does not redraw the toolbar
   305 	iToolbar->DrawNow();
   280 	iToolbar->DrawNow();
   306 	}
   281 	}
   307 
   282 
   324             {
   299             {
   325             toolbarButton->SetCurrentState( KGlxToolbarButtonUnLatched, ETrue );
   300             toolbarButton->SetCurrentState( KGlxToolbarButtonUnLatched, ETrue );
   326             }
   301             }
   327         }
   302         }
   328     }
   303     }
   329 //----------------------------------------------------------------------------
   304 //end of file
   330 // Check for current view mode .Grid/fullscreen/imgviewer
       
   331 //----------------------------------------------------------------------------
       
   332 //
       
   333 TBool CGlxToolbarController::IsFullScreenView()
       
   334     {
       
   335     TBool fullscreenViewingMode = EFalse;
       
   336              
       
   337      CGlxNavigationalState* aNavigationalState = CGlxNavigationalState::InstanceL();
       
   338      CMPXCollectionPath* naviState = aNavigationalState->StateLC();
       
   339      
       
   340      if ( naviState->Levels() >= 1)
       
   341          {
       
   342          if (aNavigationalState->ViewingMode() == NGlxNavigationalState::EBrowse) 
       
   343              {
       
   344              // For image viewer collection, goto view mode
       
   345              if (naviState->Id() == TMPXItemId(KGlxCollectionPluginImageViewerImplementationUid))
       
   346                  {
       
   347                  // current view mode is img vwr
       
   348                  fullscreenViewingMode = ETrue;
       
   349                  }
       
   350              else
       
   351                  {
       
   352                  //current view mode is Grid 
       
   353                  fullscreenViewingMode = EFalse;
       
   354                  }
       
   355              } 
       
   356          else 
       
   357              {
       
   358              //current view mode is Fullscreen
       
   359              fullscreenViewingMode = ETrue;
       
   360              }                
       
   361          }
       
   362      CleanupStack::PopAndDestroy( naviState );
       
   363      aNavigationalState->Close();
       
   364      return fullscreenViewingMode;
       
   365     }
       
   366 //end os file
       
   367 	
   305