void frmSearch::SearchContacts( wxCommandEvent& event )
{
+ // Check if any accounts has been selected.
+
+ bool AccountsFound = false;
+
+ for (std::map<wxString, bool>::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){