Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Implemented loading for EMAIL using ContactDataObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 29 Dec 2015 02:20:18 +0000 (02:20 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 29 Dec 2015 02:20:18 +0000 (02:20 +0000)
source/contacteditor/frmContactEditor-Load.cpp
source/contacteditor/frmContactEditor-LoadEmail.cpp
source/contacteditor/frmContactEditor.h

index c8e1362..aa5b0e9 100644 (file)
@@ -166,7 +166,7 @@ bool frmContactEditor::LoadContact(wxString Filename){
                
        LoadMember(&ContactEditorData.GroupsList);
 
-       // Process the address (ADR) (frmContactEditor-LoadAddress.cpp)
+       // Process the addresses (ADR) (frmContactEditor-LoadAddress.cpp)
        
        LoadAddress(&ContactEditorData.GeneralAddressList,
                &ContactEditorData.GeneralAddressListTown,
@@ -185,7 +185,7 @@ bool frmContactEditor::LoadContact(wxString Filename){
                &ContactEditorData.BusinessAddressListPref,
                &ADRCount);
 
-       // Process the timezone (TZ) (frmContactEditor-LoadTimeZone.cpp)
+       // Process the timezones (TZ) (frmContactEditor-LoadTimeZone.cpp)
        
        LoadTimeZone(&ContactEditorData.GeneralTZList,
                &ContactEditorData.GeneralTZListPref,
@@ -194,6 +194,16 @@ bool frmContactEditor::LoadContact(wxString Filename){
                &ContactEditorData.BusinessTZList,
                &ContactEditorData.BusinessTZListPref,
                &TZCount);
+               
+       // Process the emails (frmContactEditor-LoadEmail.cpp)
+       
+       LoadEmail(&ContactEditorData.GeneralEmailList,
+               &ContactEditorData.GeneralEmailListPref,
+               &ContactEditorData.HomeEmailList,
+               &ContactEditorData.HomeEmailListPref,
+               &ContactEditorData.BusinessEmailList,
+               &ContactEditorData.BusinessEmailListPref,
+               &EmailCount);   
 
        for (std::map<int,wxString>::iterator iter = ContactFileLines.begin(); 
         iter != ContactFileLines.end(); ++iter){
@@ -356,13 +366,13 @@ bool frmContactEditor::LoadContact(wxString Filename){
                
                        LoadADR(wxSPropertySeg1, wxSPropertySeg2, &ADRCount);
                
-               }*/ else if (wxSProperty == wxT("EMAIL")){
+               } else if (wxSProperty == wxT("EMAIL")){
                
                        // See frmContactEditor-LoadEmail.cpp
                        
                        LoadEmail(wxSPropertySeg1, wxSPropertySeg2, &EmailCount);       
                
-               } else if (wxSProperty == wxT("IMPP")){
+               }*/ else if (wxSProperty == wxT("IMPP")){
                
                        // See frmContactEditor-LoadIM.cpp
                
index fef123b..afb08d3 100644 (file)
 
 #include "frmContactEditor.h"
 
+void frmContactEditor::LoadEmail(std::map<int, wxString> *GeneralEmailListPtr,
+               std::map<int, int> *GeneralEmailListPrefPtr,
+               std::map<int, wxString> *HomeEmailListPtr,
+               std::map<int, int> *HomeEmailListPrefPtr,
+               std::map<int, wxString> *BusinessEmailListPtr,
+               std::map<int, int> *BusinessEmailListPrefPtr,
+               int *EmailCount){
+
+       long ListCtrlIndex = -1;
+
+       // Deal with the general addresses.
+       
+       for (std::map<int,wxString>::iterator Iter = GeneralEmailListPtr->begin();
+               Iter != GeneralEmailListPtr->end();
+               Iter++){
+       
+               wxListItem coldata;
+
+               coldata.SetId(*EmailCount);
+               coldata.SetData(*EmailCount);
+               coldata.SetText(Iter->second);
+               
+               ListCtrlIndex = lboEmails->InsertItem(coldata);
+
+               if (MapDataExists(EmailCount, GeneralEmailListPrefPtr)){
+               
+                       lboEmails->SetItem(ListCtrlIndex, 1, wxString::Format("%i", GeneralEmailListPrefPtr->find(*EmailCount)->second));
+               
+               }
+       
+               (*EmailCount)++;
+       
+       }
+       
+       // Deal with the home addresses.
+       
+       for (std::map<int,wxString>::iterator Iter = HomeEmailListPtr->begin();
+               Iter != HomeEmailListPtr->end();
+               Iter++){
+       
+               wxListItem coldata;
+
+               coldata.SetId(*EmailCount);
+               coldata.SetData(*EmailCount);
+               coldata.SetText(Iter->second);
+               
+               ListCtrlIndex = lboHomeEmails->InsertItem(coldata);
+
+               if (MapDataExists(EmailCount, HomeEmailListPrefPtr)){
+               
+                       lboHomeEmails->SetItem(ListCtrlIndex, 1, wxString::Format("%i", HomeEmailListPrefPtr->find(*EmailCount)->second));
+               
+               }
+       
+               (*EmailCount)++;
+       
+       }
+       
+       // Deal with the work addresses.
+       
+       for (std::map<int,wxString>::iterator Iter = BusinessEmailListPtr->begin();
+               Iter != BusinessEmailListPtr->end();
+               Iter++){
+       
+               wxListItem coldata;
+
+               coldata.SetId(*EmailCount);
+               coldata.SetData(*EmailCount);
+               coldata.SetText(Iter->second);
+               
+               ListCtrlIndex = lboBusinessEmail->InsertItem(coldata);
+                               
+               if (MapDataExists(EmailCount, BusinessEmailListPrefPtr)){
+               
+                       lboBusinessEmail->SetItem(ListCtrlIndex, 1, wxString::Format("%i", BusinessEmailListPrefPtr->find(*EmailCount)->second));
+               
+               }
+       
+               (*EmailCount)++;
+       
+       }
+
+}
+
 void frmContactEditor::LoadEmail(wxString wxSPropertySeg1, wxString wxSPropertySeg2, int *EmailCount){
 
        size_t intPropertyLen = wxSPropertySeg1.Len();
index e5ceb88..a9f0ab5 100644 (file)
@@ -670,6 +670,13 @@ class frmContactEditor : public frmContactEditorADT
                        std::map<int, wxString> *BusinessTZListPtr,
                        std::map<int, int> *BusinessTZListPrefPtr,
                        int *TZCount);
+               void LoadEmail(std::map<int, wxString> *GeneralEmailListPtr,
+                       std::map<int, int> *GeneralEmailListPrefPtr,
+                       std::map<int, wxString> *HomeEmailListPtr,
+                       std::map<int, int> *HomeEmailListPrefPtr,
+                       std::map<int, wxString> *BusinessEmailListPtr,
+                       std::map<int, int> *BusinessEmailListPrefPtr,
+                       int *EmailCount);
        
                int intValueSeek = 1;
                bool IsGroup = FALSE;
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