Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Fixed right click menu which showed active menu items when it shouldn't in Search...
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 1 Dec 2015 12:10:34 +0000 (12:10 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 1 Dec 2015 12:10:34 +0000 (12:10 +0000)
source/search/frmSearch-contact.cpp
source/widgets/XABContactMenu.cpp
source/widgets/XABContactMenu.h

index f5c18b8..2f168bb 100644 (file)
@@ -137,7 +137,7 @@ void frmSearch::RevealContact( wxCommandEvent& event ){
 
 void frmSearch::ShowContactMenu( wxMouseEvent& event ){
 
-       ContactMenu->SetupPointers(this, lstResults);
+       ContactMenu->SetupPointersSearch(this, lstResults, SearchMode);
 
        PopupMenu(ContactMenu->MenuPointer(), wxDefaultPosition);
 
index fc3f59a..b468833 100644 (file)
@@ -109,11 +109,13 @@ void XABContactMenu::AppendMenuItem(wxString ObjectName,
 
 }
 
-void XABContactMenu::SetupPointers(wxWindow* WindowPtrIn,
-       wxListCtrl* ContactListCtrlIn){
+void XABContactMenu::SetupPointersSearch(wxWindow* WindowPtrIn,
+       wxListCtrl* ContactListCtrlIn,
+       bool SearchModeOnlyIn){
 
        WindowPtr = WindowPtrIn;
        ContactListCtrl = ContactListCtrlIn;
+       SearchModeOnly = SearchModeOnlyIn;
 
 }
 
@@ -177,10 +179,22 @@ wxMenu* XABContactMenu::MenuPointer(){
        
                std::map<std::string, wxMenuItem*>::iterator MenuItemIter = MenuItems.find("opencontact");
                MenuItemIter->second->Enable(ContactSelected);
-               MenuItemIter = MenuItems.find("editcontact");
-               MenuItemIter->second->Enable(ContactSelected);
-               MenuItemIter = MenuItems.find("revealcontact");
-               MenuItemIter->second->Enable(ContactSelected);
+               
+               if (SearchModeOnly == TRUE){
+
+                       MenuItemIter = MenuItems.find("editcontact");
+                       MenuItemIter->second->Enable(FALSE);
+                       MenuItemIter = MenuItems.find("revealcontact");
+                       MenuItemIter->second->Enable(FALSE);
+               
+               } else {
+               
+                       MenuItemIter = MenuItems.find("editcontact");
+                       MenuItemIter->second->Enable(ContactSelected);
+                       MenuItemIter = MenuItems.find("revealcontact");
+                       MenuItemIter->second->Enable(ContactSelected);
+       
+               }
        
        }
 
index c90c8d3..13e0cff 100644 (file)
@@ -51,6 +51,7 @@ class XABContactMenu : public XABContactMenuADT
                wxListCtrl *ContactListCtrl = NULL;
                wxWindow *WindowPtr = NULL;
                bool EnableAccountSettings = FALSE;
+               bool SearchModeOnly = FALSE;
                void AppendMenuItem(wxString ObjectName,
                        wxString MenuName, 
                        wxString MenuDescription,
@@ -61,8 +62,9 @@ class XABContactMenu : public XABContactMenuADT
        public:
                XABContactMenu(int MenuType);
                ~XABContactMenu();
-               void SetupPointers(wxWindow* WindowPtrIn,
-                       wxListCtrl* ContactListCtrlIn);
+               void SetupPointersSearch(wxWindow* WindowPtrIn,
+                       wxListCtrl* ContactListCtrlIn,
+                       bool SearchModeOnlyIn);
                void SetupPointers(wxWindow* WindowPtrIn,
                        wxListCtrl* ContactListCtrlIn, 
                        bool EnableAccountSettingsIn);
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy