X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Load.cpp;h=14b20bda9751b0012465bb96c37404af2022ca96;hb=2171887a85a5eca924e73c23422a9fcc91e11bb2;hp=c8e13622f639d3759f8b774b56f3466bf385f274;hpb=77d83d8634baf045dc48cdcc699dd7cb64538edb;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Load.cpp b/source/contacteditor/frmContactEditor-Load.cpp index c8e1362..14b20bd 100644 --- a/source/contacteditor/frmContactEditor-Load.cpp +++ b/source/contacteditor/frmContactEditor-Load.cpp @@ -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,15 +185,83 @@ bool frmContactEditor::LoadContact(wxString Filename){ &ContactEditorData.BusinessAddressListPref, &ADRCount); - // Process the timezone (TZ) (frmContactEditor-LoadTimeZone.cpp) + // Process the timezones (TZ). - LoadTimeZone(&ContactEditorData.GeneralTZList, + LoadData(&ContactEditorData.GeneralTZList, &ContactEditorData.GeneralTZListPref, + lboTimezones, &ContactEditorData.HomeTZList, &ContactEditorData.HomeTZListPref, + lboHomeTimezones, &ContactEditorData.BusinessTZList, &ContactEditorData.BusinessTZListPref, + lboBusinessTimezones, &TZCount); + + // Process the emails (EMAIL). + + LoadData(&ContactEditorData.GeneralEmailList, + &ContactEditorData.GeneralEmailListPref, + lboEmails, + &ContactEditorData.HomeEmailList, + &ContactEditorData.HomeEmailListPref, + lboHomeEmails, + &ContactEditorData.BusinessEmailList, + &ContactEditorData.BusinessEmailListPref, + lboBusinessEmail, + &EmailCount); + + // Process the nicknames (NICKNAME). + + LoadData(&ContactEditorData.GeneralNicknamesList, + &ContactEditorData.GeneralNicknamesListPref, + lboNicknames, + &ContactEditorData.HomeNicknamesList, + &ContactEditorData.HomeNicknamesListPref, + lboHomeNicknames, + &ContactEditorData.BusinessNicknamesList, + &ContactEditorData.BusinessNicknamesListPref, + lboBusinessNicknames, + &NicknameCount); + + // Process the languages (LANG). + + LoadData(&ContactEditorData.GeneralLanguageList, + &ContactEditorData.GeneralLanguageListPref, + lboLanguages, + &ContactEditorData.HomeLanguageList, + &ContactEditorData.HomeLanguageListPref, + lboHomeLanguages, + &ContactEditorData.BusinessLanguageList, + &ContactEditorData.BusinessLanguageListPref, + lboBusinessLanguages, + &LangCount); + + // Process the geoposition (GEO). + + LoadData(&ContactEditorData.GeneralGeographyList, + &ContactEditorData.GeneralGeographyListPref, + lboGeoposition, + &ContactEditorData.HomeGeographyList, + &ContactEditorData.HomeGeographyListPref, + lboHomeGeoposition, + &ContactEditorData.BusinessGeographyList, + &ContactEditorData.BusinessGeographyListPref, + lboBusinessGeoposition, + &GeoCount); + + // Process the website (URL). + + LoadData(&ContactEditorData.GeneralWebsiteList, + &ContactEditorData.GeneralWebsiteListPref, + lboWebsites, + &ContactEditorData.HomeWebsiteList, + &ContactEditorData.HomeWebsiteListPref, + lboHomeWebsites, + &ContactEditorData.BusinessWebsiteList, + &ContactEditorData.BusinessWebsiteListPref, + lboBusinessWebsites, + &URLCount); for (std::map::iterator iter = ContactFileLines.begin(); iter != ContactFileLines.end(); ++iter){ @@ -320,13 +388,13 @@ bool frmContactEditor::LoadContact(wxString Filename){ LoadN(wxSPropertySeg1, wxSPropertySeg2, &NameProcessed, &ContactData); - }*/ else if (wxSProperty == wxT("NICKNAME")){ + } else if (wxSProperty == wxT("NICKNAME")){ // See frmContactEditor-LoadNickname.cpp LoadNickname(wxSPropertySeg1, wxSPropertySeg2, &NicknameCount, &ContactData); - }/* else if (wxSProperty == wxT("GENDER") && GenderProcessed == FALSE){ + } else if (wxSProperty == wxT("GENDER") && GenderProcessed == FALSE){ // See frmContactEditor-LoadGender.cpp @@ -356,13 +424,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 @@ -374,7 +442,7 @@ bool frmContactEditor::LoadContact(wxString Filename){ LoadTelephone(wxSPropertySeg1, wxSPropertySeg2, &TelCount); - } else if (wxSProperty == wxT("LANG")){ + }/* else if (wxSProperty == wxT("LANG")){ // See frmContactEditor-LoadLanguage.cpp @@ -386,19 +454,19 @@ bool frmContactEditor::LoadContact(wxString Filename){ LoadGeo(wxSPropertySeg1, wxSPropertySeg2, &GeoCount); - } else if (wxSProperty == wxT("RELATED")){ + }*/ else if (wxSProperty == wxT("RELATED")){ // See fromContactEditor-LoadRelated.cpp LoadRelated(wxSPropertySeg1, wxSPropertySeg2, &RelatedCount); - } else if (wxSProperty == wxT("URL")){ + }/* else if (wxSProperty == wxT("URL")){ // See frmContactEditor-LoadURL.cpp LoadURL(wxSPropertySeg1, wxSPropertySeg2, &URLCount); - } else if (wxSProperty == wxT("TITLE")) { + }*/ else if (wxSProperty == wxT("TITLE")) { // See frmContactEditor-LoadTitle.cpp @@ -617,4 +685,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