Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added event to allow the contact list to be reloaded.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 4 Oct 2015 14:57:54 +0000 (15:57 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 4 Oct 2015 14:57:54 +0000 (15:57 +0100)
source/frmMain.cpp
source/frmMain.h

index d885b06..025022e 100644 (file)
@@ -70,6 +70,7 @@ DEFINE_EVENT_TYPE(INVALIDSSLCERT);
 DEFINE_EVENT_TYPE(GETSELECTEDLIST);
 DEFINE_EVENT_TYPE(SYNCACCOUNT);
 DEFINE_EVENT_TYPE(IMPORT_RESULTSSHOW);
+DEFINE_EVENT_TYPE(RELOADCONTACTLIST);
 
 BEGIN_EVENT_TABLE(frmMain, wxFrame)
 EVT_COMMAND(wxID_ANY, wxEVT_COMMAND_BUTTON_CLICKED, frmMain::ConflictResolution)
@@ -92,6 +93,7 @@ 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)
+EVT_COMMAND(wxID_ANY, RELOADCONTACTLIST, frmMain::ReloadContactList)
 END_EVENT_TABLE()
 
 frmMain::frmMain( wxWindow* parent )
@@ -2761,10 +2763,10 @@ void frmMain::GetSelectedList( wxCommandEvent& event ){
 
 void frmMain::SyncAccount( wxCommandEvent& event ){
     
-    wxString *AccNameInc = (wxString*)event.GetClientData();
+    wxString AccNameInc = event.GetString();
     
     frmActivityMgr *frameActMgr = static_cast<frmActivityMgr*>(ActMgrPtr);
-    frameActMgr->AddTask(3, wxT(""), *AccNameInc, 
+    frameActMgr->AddTask(3, wxT(""), AccNameInc, 
                          wxT(""), wxT(""), wxT(""), wxT(""));
     
 }
@@ -2828,4 +2830,18 @@ void frmMain::ShowImportResults( wxCommandEvent &event ){
        delete ResultData;
        ResultData = NULL;
 
+}
+
+void frmMain::ReloadContactList( wxCommandEvent &event ){
+
+       // Check if the account name given is the current
+       // account selected.
+
+       if (ActiveAccount == event.GetString()){
+       
+               wxTreeEvent NullEvent;
+               LoadContactList(NullEvent);
+       
+       }
+
 }
\ No newline at end of file
index ca571dc..ff8ff74 100644 (file)
@@ -49,6 +49,7 @@ DECLARE_EVENT_TYPE(INVALIDSSLCERT, wxID_ANY);
 DECLARE_EVENT_TYPE(GETSELECTEDLIST, wxID_ANY);
 DECLARE_EVENT_TYPE(SYNCACCOUNT, wxID_ANY);
 DECLARE_EVENT_TYPE(IMPORT_RESULTSSHOW, wxID_ANY);
+DECLARE_EVENT_TYPE(RELOADCONTACTLIST, wxID_ANY);
 
 struct UCNotif{
        wxString ContactAccount;
@@ -161,14 +162,14 @@ class frmMain : public frmMainADT
                void OpenNewABDialog( wxCommandEvent& event );
                void LoadPreferences( wxActivateEvent& event );
                void LoadPreferences();
-               void LoadContactList( wxTreeEvent& event );
                void ShowContactInfo( wxListEvent& event );
                void OpenContactInfo( wxListEvent& event );
                void OpenContactInfo( wxCommandEvent& event );
                void ShowContactEditorNew( wxCommandEvent& event );             
                void ShowContactEditorEdit( wxCommandEvent& event );
                void RefreshAddressBook( wxCommandEvent& event );
-               void ShowActivityWindow( wxCommandEvent& event );               
+               void ShowActivityWindow( wxCommandEvent& event );
+               void LoadContactList( wxTreeEvent& event );             
                wxTreeItemId FindItemNamed(wxTreeCtrl &tree, 
                              const std::wstring &name);
                void ConflictResolution( wxCommandEvent& event );
@@ -225,6 +226,7 @@ class frmMain : public frmMainADT
                void UpdateSSLAccountStatus(int AccountID, int SSLStatus, SSLCertCollection SSLCertInc);
                void GetListControl(wxListCtrl *lstContactsPtr, wxArrayString *ContactsFileIndexPtr);
                void ShowImportResults( wxCommandEvent& event );
+               void ReloadContactList( wxCommandEvent& event );
                XABViewMode GetViewMode();
                DECLARE_EVENT_TABLE()
 
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