From: Steve Brokenshire Date: Wed, 24 Feb 2016 13:13:28 +0000 (+0000) Subject: Added check to see if any accounts are selected. X-Git-Tag: release-0.09~9 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;ds=sidebyside;h=b6a3ed2ed9296b967570f1f5279613ba64b1e1d9;p=xestiaab%2F.git Added check to see if any accounts are selected. --- 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){