X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Fcontacteditor%2FfrmContactEditor-Load.cpp;h=d6f47ea5e803af9dec07139465c5b63ed53c57fa;hb=2b6a6878b89192f2d951511d6936d564fd8baf46;hp=14b20bda9751b0012465bb96c37404af2022ca96;hpb=2171887a85a5eca924e73c23422a9fcc91e11bb2;p=xestiaab%2F.git diff --git a/source/contacteditor/frmContactEditor-Load.cpp b/source/contacteditor/frmContactEditor-Load.cpp index 14b20bd..d6f47ea 100644 --- a/source/contacteditor/frmContactEditor-Load.cpp +++ b/source/contacteditor/frmContactEditor-Load.cpp @@ -237,7 +237,7 @@ bool frmContactEditor::LoadContact(wxString Filename){ lboBusinessLanguages, &LangCount); - // Process the geoposition (GEO). + // Process the geopositiosn (GEO). LoadData(&ContactEditorData.GeneralGeographyList, &ContactEditorData.GeneralGeographyListPref, @@ -250,7 +250,7 @@ bool frmContactEditor::LoadContact(wxString Filename){ lboBusinessGeoposition, &GeoCount); - // Process the website (URL). + // Process the websites (URL). LoadData(&ContactEditorData.GeneralWebsiteList, &ContactEditorData.GeneralWebsiteListPref, @@ -263,6 +263,65 @@ bool frmContactEditor::LoadContact(wxString Filename){ 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::iterator iter = ContactFileLines.begin(); iter != ContactFileLines.end(); ++iter){ @@ -466,7 +525,7 @@ bool frmContactEditor::LoadContact(wxString Filename){ LoadURL(wxSPropertySeg1, wxSPropertySeg2, &URLCount); - }*/ else if (wxSProperty == wxT("TITLE")) { + } else if (wxSProperty == wxT("TITLE")) { // See frmContactEditor-LoadTitle.cpp @@ -496,7 +555,7 @@ bool frmContactEditor::LoadContact(wxString Filename){ LoadCategory(wxSPropertySeg1, wxSPropertySeg2, &CategoryCount); - } else if (wxSProperty == wxT("PHOTO")) { + }*/ else if (wxSProperty == wxT("PHOTO")) { // See frmContactEditor-LoadPhoto.cpp @@ -700,7 +759,7 @@ void frmContactEditor::LoadData(std::map *GeneralList, long ListCtrlIndex = -1; - // Deal with the general addresses. + // Deal with the general items. for (std::map::iterator Iter = GeneralList->begin(); Iter != GeneralList->end(); @@ -724,7 +783,7 @@ void frmContactEditor::LoadData(std::map *GeneralList, } - // Deal with the home addresses. + // Deal with the home items. for (std::map::iterator Iter = HomeList->begin(); Iter != HomeList->end(); @@ -748,7 +807,7 @@ void frmContactEditor::LoadData(std::map *GeneralList, } - // Deal with the work addresses. + // Deal with the work items. for (std::map::iterator Iter = BusinessList->begin(); Iter != BusinessList->end(); @@ -772,4 +831,35 @@ void frmContactEditor::LoadData(std::map *GeneralList, } +} + +void frmContactEditor::LoadData(std::map *ItemList, + std::map *ItemListPref, + wxListCtrl *ItemCtrl, + int *DataCount){ + + long ListCtrlIndex = -1; + + for (std::map::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