X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Load.cpp;h=7e35538f97ca691d3cee32cf4707d683e1c8be8e;hb=6aea74e8b371da97bfc7d8e102e6b9a72767c875;hp=aa5b0e9d845df99ea4c13a6cf4896ef566726efb;hpb=01a3141be71e31f6eabd97d65cb630ddeaa1a5c9;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Load.cpp b/source/contacteditor/frmContactEditor-Load.cpp index aa5b0e9..7e35538 100644 --- a/source/contacteditor/frmContactEditor-Load.cpp +++ b/source/contacteditor/frmContactEditor-Load.cpp @@ -185,25 +185,96 @@ bool frmContactEditor::LoadContact(wxString Filename){ &ContactEditorData.BusinessAddressListPref, &ADRCount); - // Process the timezones (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 (frmContactEditor-LoadEmail.cpp) + // Process the emails (EMAIL). - LoadEmail(&ContactEditorData.GeneralEmailList, + LoadData(&ContactEditorData.GeneralEmailList, &ContactEditorData.GeneralEmailListPref, + lboEmails, &ContactEditorData.HomeEmailList, &ContactEditorData.HomeEmailListPref, + lboHomeEmails, &ContactEditorData.BusinessEmailList, &ContactEditorData.BusinessEmailListPref, - &EmailCount); + 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 geopositiosn (GEO). + + LoadData(&ContactEditorData.GeneralGeographyList, + &ContactEditorData.GeneralGeographyListPref, + lboGeoposition, + &ContactEditorData.HomeGeographyList, + &ContactEditorData.HomeGeographyListPref, + lboHomeGeoposition, + &ContactEditorData.BusinessGeographyList, + &ContactEditorData.BusinessGeographyListPref, + lboBusinessGeoposition, + &GeoCount); + + // Process the websites (URL). + + LoadData(&ContactEditorData.GeneralWebsiteList, + &ContactEditorData.GeneralWebsiteListPref, + lboWebsites, + &ContactEditorData.HomeWebsiteList, + &ContactEditorData.HomeWebsiteListPref, + lboHomeWebsites, + &ContactEditorData.BusinessWebsiteList, + &ContactEditorData.BusinessWebsiteListPref, + lboBusinessWebsites, + &URLCount); + + // Process the titles (TITLE). + + LoadData(&ContactEditorData.GeneralTitleList, + &ContactEditorData.GeneralTitleListPref, + lboTitles, + &ContactEditorData.HomeTitleList, + &ContactEditorData.HomeTitleListPref, + lboHomeTitles, + &ContactEditorData.BusinessTitleList, + &ContactEditorData.BusinessTitleListPref, + lboBusinessTitles, + &TitleCount); for (std::map::iterator iter = ContactFileLines.begin(); iter != ContactFileLines.end(); ++iter){ @@ -330,13 +401,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 @@ -384,7 +455,7 @@ bool frmContactEditor::LoadContact(wxString Filename){ LoadTelephone(wxSPropertySeg1, wxSPropertySeg2, &TelCount); - } else if (wxSProperty == wxT("LANG")){ + }/* else if (wxSProperty == wxT("LANG")){ // See frmContactEditor-LoadLanguage.cpp @@ -396,13 +467,13 @@ 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 @@ -414,7 +485,7 @@ bool frmContactEditor::LoadContact(wxString Filename){ LoadTitle(wxSPropertySeg1, wxSPropertySeg2, &TitleCount); - } else if (wxSProperty == wxT("ROLE")) { + }*/ else if (wxSProperty == wxT("ROLE")) { // See frmContactEditor-LoadRole.cpp @@ -627,4 +698,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