X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Load.cpp;h=a48d0a33fef66b35b6790f1818e929fdb70ff880;hb=5482d15a8b8fa45ff634f183fa3af669de55e4b9;hp=a0f67ea557b8761bbef71de8ae65749c12168411;hpb=06c2ed8b03776fa476de5043a8c09e00d3a481f5;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Load.cpp b/source/contacteditor/frmContactEditor-Load.cpp index a0f67ea..a48d0a3 100644 --- a/source/contacteditor/frmContactEditor-Load.cpp +++ b/source/contacteditor/frmContactEditor-Load.cpp @@ -90,13 +90,13 @@ bool frmContactEditor::LoadContact(wxString Filename){ bool HasExtraNicknames = FALSE; bool IgnoreGender = FALSE; bool ExtraLineSeek = TRUE; - bool BirthdayProcessed = FALSE; - bool AnniversaryProcessed = FALSE; + //bool BirthdayProcessed = FALSE; + //bool AnniversaryProcessed = FALSE; bool FNProcessed = FALSE; bool GenderProcessed = FALSE; bool NameProcessed = FALSE; - bool UIDProcessed = FALSE; - bool KindProcessed = FALSE; + //bool UIDProcessed = FALSE; + //bool KindProcessed = FALSE; bool ETagFound = FALSE; bool ETagOrigFound = FALSE; bool VersionProcessed = FALSE; @@ -136,6 +136,10 @@ bool frmContactEditor::LoadContact(wxString Filename){ int XTokenCount = 0; //int intValueSeek = 1; + // Process the unique ID (UID) + + UIDToken = ContactEditorData.UIDToken; + // Process the contact type (KIND) (frmContactEditor-LoadGroup.cpp) LoadKind(&ContactEditorData.ContactKind); @@ -151,6 +155,74 @@ bool frmContactEditor::LoadContact(wxString Filename){ // Process the Gender (GENDER) (frmContactEditor-LoadGender.cpp) LoadGender(&ContactEditorData.Gender, &ContactEditorData.GenderDetails); + + // Process the Name (N) (frmContactEditor-LoadName.cpp) + + LoadName(&ContactEditorData.NameTitle, &ContactEditorData.NameForename, + &ContactEditorData.NameSurname, &ContactEditorData.NameOtherNames, + &ContactEditorData.NameSuffix); + + // Process the group members (MEMBER) (frmContactEditor-LoadGroup.cpp) + + LoadMember(&ContactEditorData.GroupsList); + + // Process the addresses (ADR) (frmContactEditor-LoadAddress.cpp) + + LoadAddress(&ContactEditorData.GeneralAddressList, + &ContactEditorData.GeneralAddressListTown, + &ContactEditorData.GeneralAddressListCounty, + &ContactEditorData.GeneralAddressListPostCode, + &ContactEditorData.GeneralAddressListPref, + &ContactEditorData.HomeAddressList, + &ContactEditorData.HomeAddressListTown, + &ContactEditorData.HomeAddressListCounty, + &ContactEditorData.HomeAddressListPostCode, + &ContactEditorData.HomeAddressListPref, + &ContactEditorData.BusinessAddressList, + &ContactEditorData.BusinessAddressListTown, + &ContactEditorData.BusinessAddressListCounty, + &ContactEditorData.BusinessAddressListPostCode, + &ContactEditorData.BusinessAddressListPref, + &ADRCount); + + // Process the timezones (TZ) (frmContactEditor-LoadTimeZone.cpp) + + LoadData(&ContactEditorData.GeneralTZList, + &ContactEditorData.GeneralTZListPref, + lboTimezones, + &ContactEditorData.HomeTZList, + &ContactEditorData.HomeTZListPref, + lboHomeTimezones, + &ContactEditorData.BusinessTZList, + &ContactEditorData.BusinessTZListPref, + lboBusinessTimezones, + &TZCount); + + // Process the emails (EMAIL) (frmContactEditor-LoadEmail.cpp) + + LoadData(&ContactEditorData.GeneralEmailList, + &ContactEditorData.GeneralEmailListPref, + lboEmails, + &ContactEditorData.HomeEmailList, + &ContactEditorData.HomeEmailListPref, + lboHomeEmails, + &ContactEditorData.BusinessEmailList, + &ContactEditorData.BusinessEmailListPref, + lboBusinessEmail, + &EmailCount); + + // Process the nicknames (NICKNAME) (frmContactEditor-LoadNickname.cpp) + + LoadData(&ContactEditorData.GeneralNicknamesList, + &ContactEditorData.GeneralNicknamesListPref, + lboNicknames, + &ContactEditorData.HomeNicknamesList, + &ContactEditorData.HomeNicknamesListPref, + lboHomeNicknames, + &ContactEditorData.BusinessNicknamesList, + &ContactEditorData.BusinessNicknamesListPref, + lboBusinessNicknames, + &NicknameCount); for (std::map::iterator iter = ContactFileLines.begin(); iter != ContactFileLines.end(); ++iter){ @@ -259,19 +331,19 @@ bool frmContactEditor::LoadContact(wxString Filename){ LoadKind(wxSPropertySeg2); - }*/ else if (wxSProperty == wxT("MEMBER")){ + }/* else if (wxSProperty == wxT("MEMBER")){ // See frmContactEditor-LoadGroup.cpp LoadMember(wxSPropertySeg2, &GroupCount); - } else if (wxSProperty == wxT("FN")){ + }*/ else if (wxSProperty == wxT("FN")){ // See frmContactEditor-LoadName.cpp LoadFN(wxSPropertySeg1, wxSPropertySeg2, &FNCount, &FNProcessed, &ContactData); - } else if (wxSProperty == wxT("N") && NameProcessed == FALSE){ + }/* else if (wxSProperty == wxT("N") && NameProcessed == FALSE){ // See frmContactEditor-LoadName.cpp @@ -283,7 +355,7 @@ bool frmContactEditor::LoadContact(wxString Filename){ LoadNickname(wxSPropertySeg1, wxSPropertySeg2, &NicknameCount, &ContactData); - }/* else if (wxSProperty == wxT("GENDER") && GenderProcessed == FALSE){ + } else if (wxSProperty == wxT("GENDER") && GenderProcessed == FALSE){ // See frmContactEditor-LoadGender.cpp @@ -301,13 +373,13 @@ bool frmContactEditor::LoadContact(wxString Filename){ LoadAnniversary(wxSPropertySeg1, wxSPropertySeg2, &AnniversaryProcessed); - }*/ else if (wxSProperty == wxT("TZ")){ + } else if (wxSProperty == wxT("TZ")){ // See frmContactEditor-LoadTimeZone.cpp LoadTimeZone(wxSPropertySeg1, wxSPropertySeg2, &TZCount); - } else if (wxSProperty == wxT("ADR")){ + } else if (wxSProperty == wxT("ADR")){ // See frmContactEditor-LoadAddress.cpp @@ -319,7 +391,7 @@ bool frmContactEditor::LoadContact(wxString Filename){ LoadEmail(wxSPropertySeg1, wxSPropertySeg2, &EmailCount); - } else if (wxSProperty == wxT("IMPP")){ + }*/ else if (wxSProperty == wxT("IMPP")){ // See frmContactEditor-LoadIM.cpp @@ -427,12 +499,12 @@ bool frmContactEditor::LoadContact(wxString Filename){ LoadKey(wxSPropertySeg1, wxSPropertySeg2, &KeyCount); - } else if (wxSProperty == wxT("UID") && UIDProcessed == FALSE){ + }/* else if (wxSProperty == wxT("UID") && UIDProcessed == FALSE){ UIDToken = wxSPropertySeg2; UIDProcessed = TRUE; - } else if (wxSProperty.Mid(0, 3) == wxT("VND")){ + }*/ else if (wxSProperty.Mid(0, 3) == wxT("VND")){ // Split the Vendor three ways. @@ -574,4 +646,91 @@ void frmContactEditor::SplitValues(wxString *PropertyLine, } +} + +void frmContactEditor::LoadData(std::map *GeneralList, + std::map *GeneralListPref, + wxListCtrl *GeneralListCtrl, + std::map *HomeList, + std::map *HomeListPref, + wxListCtrl *HomeListCtrl, + std::map *BusinessList, + std::map *BusinessListPref, + wxListCtrl *BusinessListCtrl, + int *DataCount){ + + long ListCtrlIndex = -1; + + // Deal with the general addresses. + + for (std::map::iterator Iter = GeneralList->begin(); + Iter != GeneralList->end(); + Iter++){ + + wxListItem coldata; + + coldata.SetId(*DataCount); + coldata.SetData(*DataCount); + coldata.SetText(Iter->second); + + ListCtrlIndex = GeneralListCtrl->InsertItem(coldata); + + if (MapDataExists(DataCount, GeneralListPref)){ + + GeneralListCtrl->SetItem(ListCtrlIndex, 1, wxString::Format("%i", GeneralListPref->find(*DataCount)->second)); + + } + + (*DataCount)++; + + } + + // Deal with the home addresses. + + for (std::map::iterator Iter = HomeList->begin(); + Iter != HomeList->end(); + Iter++){ + + wxListItem coldata; + + coldata.SetId(*DataCount); + coldata.SetData(*DataCount); + coldata.SetText(Iter->second); + + ListCtrlIndex = HomeListCtrl->InsertItem(coldata); + + if (MapDataExists(DataCount, HomeListPref)){ + + HomeListCtrl->SetItem(ListCtrlIndex, 1, wxString::Format("%i", HomeListPref->find(*DataCount)->second)); + + } + + (*DataCount)++; + + } + + // Deal with the work addresses. + + for (std::map::iterator Iter = BusinessList->begin(); + Iter != BusinessList->end(); + Iter++){ + + wxListItem coldata; + + coldata.SetId(*DataCount); + coldata.SetData(*DataCount); + coldata.SetText(Iter->second); + + ListCtrlIndex = BusinessListCtrl->InsertItem(coldata); + + if (MapDataExists(DataCount, BusinessListPref)){ + + BusinessListCtrl->SetItem(ListCtrlIndex, 1, wxString::Format("%i", BusinessListPref->find(*DataCount)->second)); + + } + + (*DataCount)++; + + } + } \ No newline at end of file