From b85066836998d2e8834dc224e61e9855381671e4 Mon Sep 17 00:00:00 2001 From: Kiri Date: Thu, 13 Aug 2015 10:30:36 +0100 Subject: [PATCH] Display error message when trying to refresh address book from a local account. --- source/frmMain.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/source/frmMain.cpp b/source/frmMain.cpp index 8e6ec60..c062c15 100644 --- a/source/frmMain.cpp +++ b/source/frmMain.cpp @@ -1210,15 +1210,26 @@ void frmMain::ShowContactEditorEdit( wxCommandEvent& event ) } void frmMain::RefreshAddressBook( wxCommandEvent& event ){ - - // TODO: Check Account Type. + + // Check if ActiveAccount is empty. If not then check if + // account type is not local otherwise continue. if (!ActiveAccount.IsEmpty()){ - - frmActivityMgr *frameActMgr = static_cast(ActMgrPtr); - frameActMgr->AddTask(3, wxT(""), ActiveAccount, - wxT(""), wxT(""), wxT(""), wxT("")); - + + if (ActiveAccountType != wxT("Local")){ + + // Account type is not local. + + frmActivityMgr *frameActMgr = static_cast(ActMgrPtr); + frameActMgr->AddTask(3, wxT(""), ActiveAccount, + wxT(""), wxT(""), wxT(""), wxT("")); + + } else { + + wxMessageBox(_("The refresh address book command is not supported with this type of account."), wxT("Not supported for this type of account")); + + } + } } -- 2.39.5