phonebookui/Phonebook2/NamesListExtension/src/NamesListExView.cpp
branchRCL_3
changeset 74 6b5524b4f673
parent 68 9da50d567e3c
child 85 38bb213f60ba
--- a/phonebookui/Phonebook2/NamesListExtension/src/NamesListExView.cpp	Tue Sep 14 20:54:53 2010 +0300
+++ b/phonebookui/Phonebook2/NamesListExtension/src/NamesListExView.cpp	Wed Sep 15 11:56:55 2010 +0300
@@ -809,6 +809,20 @@
         case R_AVKON_MENUPANE_MARK_MULTIPLE:
             {
             TInt pos;
+            TInt markedContactCount = 0;
+            
+            CPbk2ContactViewListBox* listbox = 
+                static_cast<CPbk2ContactViewListBox*>(iControl->ComponentControl(0));
+            
+            if ( listbox )
+                {
+                markedContactCount = listbox->SelectionIndexes()->Count();
+                }
+            // dim the makr all item if all contacts are marked. 
+            if ( markedContactCount > 0 && markedContactCount == iControl->NumberOfContacts() )
+                {
+                aMenuPane->SetItemDimmed( EAknCmdMarkingModeMarkAll, ETrue );
+                }
             if ( aMenuPane->MenuItemExists( EAknCmdMarkingModeEnter, pos ) &&
                     iControl->NumberOfContacts() <= 0 )
                 {
@@ -818,7 +832,11 @@
             }
         case R_PHONEBOOK2_NAMESLIST_BACKUP_MENU_PLACEHOLDER:
             {
-            if ( iControl->ContactsMarked() && iMarkingModeOn )
+            TInt pos = 0;
+            // Checks whether there are marked contacts and
+            // whether menu pane contains the menu item
+            if ( iMarkingModeOn && iControl->ContactsMarked() &&
+                    aMenuPane->MenuItemExists( EPmuCmdCascadingBackup, pos ) )
                 {
                 // This item is shown in option menu but not in popup menu
                 CEikMenuBar* menuBar = static_cast<CEikMenuBar*>( aMenuPane->Parent() );
@@ -835,8 +853,12 @@
             }
         case R_PHONEBOOK2_NAMESLIST_SEND_URL_MENU:
             {
+            TInt pos = 0;
             DimItem( aMenuPane, EPbk2CmdGoToURL );
-            if ( iControl->ContactsMarked() && iMarkingModeOn )
+            // Checks whether there are marked contacts and
+            // whether menu pane contains the menu item
+            if ( iMarkingModeOn && iControl->ContactsMarked() &&
+                    aMenuPane->MenuItemExists( EPbk2CmdSend, pos ) )
                 {
                 aMenuPane->SetItemDimmed( EPbk2CmdSend, EFalse );
                 }
@@ -1614,7 +1636,7 @@
 //
 TBool CPbk2NamesListExView::ExitMarkingMode() const
     {
-    return EFalse; 
+    return ETrue; 
     }
     
 //---------------------------------------------------------------------------