X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2FfrmMain.cpp;h=d49a44d0c4d1943676e93cc7b151143e0a911867;hb=5ee17950e2c44804fbaf660837f88d725136b978;hp=8e6ec600739a0d9c73d3e87193d754e39ba4f981;hpb=b6cfc76dade74fbf1b72d53701638b85ce8a121e;p=xestiaab%2F.git diff --git a/source/frmMain.cpp b/source/frmMain.cpp index 8e6ec60..d49a44d 100644 --- a/source/frmMain.cpp +++ b/source/frmMain.cpp @@ -28,6 +28,7 @@ #include "frmSearch.h" #include "frmSSLCertificate.h" #include "frmUpdate.h" +#include "import/frmImportResults.h" #include "bitmaps.h" #include "common/preferences.h" @@ -68,6 +69,7 @@ DEFINE_EVENT_TYPE(CONNSTAT_UPDATE); DEFINE_EVENT_TYPE(INVALIDSSLCERT); DEFINE_EVENT_TYPE(GETSELECTEDLIST); DEFINE_EVENT_TYPE(SYNCACCOUNT); +DEFINE_EVENT_TYPE(IMPORT_RESULTSSHOW); BEGIN_EVENT_TABLE(frmMain, wxFrame) EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, frmMain::ConflictResolution) @@ -89,6 +91,7 @@ EVT_COMMAND(wxID_ANY, CONNSTAT_UPDATE, frmMain::UpdateConnectionStatus) EVT_COMMAND(wxID_ANY, INVALIDSSLCERT, frmMain::InvalidSSLCertificate) EVT_COMMAND(wxID_ANY, GETSELECTEDLIST, frmMain::GetSelectedList) EVT_COMMAND(wxID_ANY, SYNCACCOUNT, frmMain::SyncAccount) +EVT_COMMAND(wxID_ANY, IMPORT_RESULTSSHOW, frmMain::ShowImportResults) END_EVENT_TABLE() frmMain::frmMain( wxWindow* parent ) @@ -1210,15 +1213,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")); + + } + } } @@ -2797,4 +2811,20 @@ void frmMain::ShowHelp( wxCommandEvent& event ){ #endif +} + +void frmMain::ShowImportResults( wxCommandEvent &event ){ + + std::map *ResultData = (std::map*)event.GetClientData(); + + frmImportResults *frmIR = new frmImportResults(this); + frmIR->LoadData(ResultData, event.GetInt(), (int)event.GetExtraLong()); + frmIR->ShowModal(); + + delete frmIR; + frmIR = NULL; + + delete ResultData; + ResultData = NULL; + } \ No newline at end of file