&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);
+
+ // Process the roles (ROLE).
+
+ LoadData(&ContactEditorData.GeneralRoleList,
+ &ContactEditorData.GeneralRoleListPref,
+ lboRoles,
+ &ContactEditorData.HomeRoleList,
+ &ContactEditorData.HomeRoleListPref,
+ lboHomeRoles,
+ &ContactEditorData.BusinessRoleList,
+ &ContactEditorData.BusinessRoleListPref,
+ lboBusinessRoles,
+ &RoleCount);
+
+ // Process the roles (ORG).
+
+ LoadData(&ContactEditorData.GeneralOrganisationsList,
+ &ContactEditorData.GeneralOrganisationsListPref,
+ lboOrganisations,
+ &ContactEditorData.HomeOrganisationsList,
+ &ContactEditorData.HomeOrganisationsListPref,
+ lboHomeOrganisations,
+ &ContactEditorData.BusinessOrganisationsList,
+ &ContactEditorData.BusinessOrganisationsListPref,
+ lboBusinessOrganisations,
+ &OrgCount);
+
+ // Process the notes (NOTE).
+
+ LoadData(&ContactEditorData.GeneralNoteList,
+ &ContactEditorData.GeneralNoteListPref,
+ lboNotes,
+ &ContactEditorData.HomeNoteList,
+ &ContactEditorData.HomeNoteListPref,
+ lboHomeNotes,
+ &ContactEditorData.BusinessNoteList,
+ &ContactEditorData.BusinessNoteListPref,
+ lboBusinessNotes,
+ &NoteCount);
+
+ // Process the categories (CATEGORIES).
+
+ LoadData(&ContactEditorData.CategoriesList,
+ &ContactEditorData.CategoriesListPref,
+ lboCategories,
+ &CategoryCount);
for (std::map<int,wxString>::iterator iter = ContactFileLines.begin();
iter != ContactFileLines.end(); ++iter){
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
LoadTelephone(wxSPropertySeg1, wxSPropertySeg2, &TelCount);
- } else if (wxSProperty == wxT("LANG")){
+ }/* else if (wxSProperty == wxT("LANG")){
// See frmContactEditor-LoadLanguage.cpp
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
LoadCategory(wxSPropertySeg1, wxSPropertySeg2, &CategoryCount);
- } else if (wxSProperty == wxT("PHOTO")) {
+ }*/ else if (wxSProperty == wxT("PHOTO")) {
// See frmContactEditor-LoadPhoto.cpp
}
+}
+
+void frmContactEditor::LoadData(std::map<int, wxString> *GeneralList,
+ std::map<int, int> *GeneralListPref,
+ wxListCtrl *GeneralListCtrl,
+ std::map<int, wxString> *HomeList,
+ std::map<int, int> *HomeListPref,
+ wxListCtrl *HomeListCtrl,
+ std::map<int, wxString> *BusinessList,
+ std::map<int, int> *BusinessListPref,
+ wxListCtrl *BusinessListCtrl,
+ int *DataCount){
+
+ long ListCtrlIndex = -1;
+
+ // Deal with the general items.
+
+ for (std::map<int,wxString>::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 items.
+
+ for (std::map<int,wxString>::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 items.
+
+ for (std::map<int,wxString>::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)++;
+
+ }
+
+}
+
+void frmContactEditor::LoadData(std::map<int,wxString> *ItemList,
+ std::map<int,int> *ItemListPref,
+ wxListCtrl *ItemCtrl,
+ int *DataCount){
+
+ long ListCtrlIndex = -1;
+
+ for (std::map<int,wxString>::iterator Iter = ItemList->begin();
+ Iter != ItemList->end();
+ Iter++){
+
+ wxListItem coldata;
+
+ coldata.SetId(*DataCount);
+ coldata.SetData(*DataCount);
+ coldata.SetText(Iter->second);
+
+ ListCtrlIndex = ItemCtrl->InsertItem(coldata);
+
+ if (MapDataExists(DataCount, ItemListPref)){
+
+ ItemCtrl->SetItem(ListCtrlIndex, 1, wxString::Format("%i", ItemListPref->find(*DataCount)->second));
+
+ }
+
+ (*DataCount)++;
+
+ }
+
}
\ No newline at end of file