Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Remove backup and old files which shouldn't be in the source tree.
[xestiaab/.git] / source / frmMain.cpp
index 8e6ec60..d49a44d 100644 (file)
@@ -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<frmActivityMgr*>(ActMgrPtr);
-        frameActMgr->AddTask(3, wxT(""), ActiveAccount,
-                             wxT(""), wxT(""), wxT(""), wxT(""));
-        
+   
+       if (ActiveAccountType != wxT("Local")){
+        
+               // Account type is not local.
+       
+               frmActivityMgr *frameActMgr = static_cast<frmActivityMgr*>(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<int,wxString> *ResultData = (std::map<int,wxString>*)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
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy