807 switch (aResourceId) |
807 switch (aResourceId) |
808 { |
808 { |
809 case R_AVKON_MENUPANE_MARK_MULTIPLE: |
809 case R_AVKON_MENUPANE_MARK_MULTIPLE: |
810 { |
810 { |
811 TInt pos; |
811 TInt pos; |
|
812 TInt markedContactCount = 0; |
|
813 |
|
814 CPbk2ContactViewListBox* listbox = |
|
815 static_cast<CPbk2ContactViewListBox*>(iControl->ComponentControl(0)); |
|
816 |
|
817 if ( listbox ) |
|
818 { |
|
819 markedContactCount = listbox->SelectionIndexes()->Count(); |
|
820 } |
|
821 // dim the makr all item if all contacts are marked. |
|
822 if ( markedContactCount > 0 && markedContactCount == iControl->NumberOfContacts() ) |
|
823 { |
|
824 aMenuPane->SetItemDimmed( EAknCmdMarkingModeMarkAll, ETrue ); |
|
825 } |
812 if ( aMenuPane->MenuItemExists( EAknCmdMarkingModeEnter, pos ) && |
826 if ( aMenuPane->MenuItemExists( EAknCmdMarkingModeEnter, pos ) && |
813 iControl->NumberOfContacts() <= 0 ) |
827 iControl->NumberOfContacts() <= 0 ) |
814 { |
828 { |
815 aMenuPane->SetItemDimmed( EAknCmdMarkingModeEnter, ETrue ); |
829 aMenuPane->SetItemDimmed( EAknCmdMarkingModeEnter, ETrue ); |
816 } |
830 } |
817 break; |
831 break; |
818 } |
832 } |
819 case R_PHONEBOOK2_NAMESLIST_BACKUP_MENU_PLACEHOLDER: |
833 case R_PHONEBOOK2_NAMESLIST_BACKUP_MENU_PLACEHOLDER: |
820 { |
834 { |
821 if ( iControl->ContactsMarked() && iMarkingModeOn ) |
835 TInt pos = 0; |
|
836 // Checks whether there are marked contacts and |
|
837 // whether menu pane contains the menu item |
|
838 if ( iMarkingModeOn && iControl->ContactsMarked() && |
|
839 aMenuPane->MenuItemExists( EPmuCmdCascadingBackup, pos ) ) |
822 { |
840 { |
823 // This item is shown in option menu but not in popup menu |
841 // This item is shown in option menu but not in popup menu |
824 CEikMenuBar* menuBar = static_cast<CEikMenuBar*>( aMenuPane->Parent() ); |
842 CEikMenuBar* menuBar = static_cast<CEikMenuBar*>( aMenuPane->Parent() ); |
825 if ( menuBar && menuBar->GetMenuType() == CEikMenuBar::EMenuOptions ) |
843 if ( menuBar && menuBar->GetMenuType() == CEikMenuBar::EMenuOptions ) |
826 { |
844 { |
833 } |
851 } |
834 break; |
852 break; |
835 } |
853 } |
836 case R_PHONEBOOK2_NAMESLIST_SEND_URL_MENU: |
854 case R_PHONEBOOK2_NAMESLIST_SEND_URL_MENU: |
837 { |
855 { |
|
856 TInt pos = 0; |
838 DimItem( aMenuPane, EPbk2CmdGoToURL ); |
857 DimItem( aMenuPane, EPbk2CmdGoToURL ); |
839 if ( iControl->ContactsMarked() && iMarkingModeOn ) |
858 // Checks whether there are marked contacts and |
|
859 // whether menu pane contains the menu item |
|
860 if ( iMarkingModeOn && iControl->ContactsMarked() && |
|
861 aMenuPane->MenuItemExists( EPbk2CmdSend, pos ) ) |
840 { |
862 { |
841 aMenuPane->SetItemDimmed( EPbk2CmdSend, EFalse ); |
863 aMenuPane->SetItemDimmed( EPbk2CmdSend, EFalse ); |
842 } |
864 } |
843 break; |
865 break; |
844 } |
866 } |
1612 // otherwise the Marking mode keep active. |
1634 // otherwise the Marking mode keep active. |
1613 // ----------------------------------------------------------------------------- |
1635 // ----------------------------------------------------------------------------- |
1614 // |
1636 // |
1615 TBool CPbk2NamesListExView::ExitMarkingMode() const |
1637 TBool CPbk2NamesListExView::ExitMarkingMode() const |
1616 { |
1638 { |
1617 return EFalse; |
1639 return ETrue; |
1618 } |
1640 } |
1619 |
1641 |
1620 //--------------------------------------------------------------------------- |
1642 //--------------------------------------------------------------------------- |
1621 // CPbk2NamesListExView::CreateControlsL |
1643 // CPbk2NamesListExView::CreateControlsL |
1622 // -------------------------------------------------------------------------- |
1644 // -------------------------------------------------------------------------- |