From b6a3ed2ed9296b967570f1f5279613ba64b1e1d9 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 24 Feb 2016 13:13:28 +0000 Subject: [PATCH] Added check to see if any accounts are selected. --- source/search/frmSearch.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source/search/frmSearch.cpp b/source/search/frmSearch.cpp index b4b8104..23b32b6 100644 --- a/source/search/frmSearch.cpp +++ b/source/search/frmSearch.cpp @@ -133,6 +133,31 @@ void frmSearch::SelectAccounts( wxCommandEvent& event ) void frmSearch::SearchContacts( wxCommandEvent& event ) { + // Check if any accounts has been selected. + + bool AccountsFound = false; + + for (std::map::iterator saiter = SearchAccounts.begin(); + saiter != SearchAccounts.end(); saiter++){ + + if (saiter->second == true){ + + AccountsFound = true; + break; + + } + + } + + if (AccountsFound == false){ + + wxMessageBox(_("No accounts have been selected to search contacts for."), + _("No accounts selected"), + wxOK|wxICON_ERROR); + return; + + } + // Change the button to stop. if (StopMode == FALSE){ -- 2.39.5