From 06c2ed8b03776fa476de5043a8c09e00d3a481f5 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 28 Dec 2015 19:43:17 +0000 Subject: [PATCH] Introduced simplified LoadKind. --- .../contacteditor/frmContactEditor-Load.cpp | 8 ++++-- .../frmContactEditor-LoadGroup.cpp | 28 +++++++++++++++++++ source/contacteditor/frmContactEditor.h | 1 + 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/source/contacteditor/frmContactEditor-Load.cpp b/source/contacteditor/frmContactEditor-Load.cpp index 8449f61..a0f67ea 100644 --- a/source/contacteditor/frmContactEditor-Load.cpp +++ b/source/contacteditor/frmContactEditor-Load.cpp @@ -136,6 +136,10 @@ bool frmContactEditor::LoadContact(wxString Filename){ int XTokenCount = 0; //int intValueSeek = 1; + // Process the contact type (KIND) (frmContactEditor-LoadGroup.cpp) + + LoadKind(&ContactEditorData.ContactKind); + // Process the Birthday (BDAY) (frmContactEditor-LoadBADays.cpp) LoadBirthday(&ContactEditorData.Birthday, &ContactEditorData.BirthdayText); @@ -249,13 +253,13 @@ bool frmContactEditor::LoadContact(wxString Filename){ VersionProcessed = TRUE; - } if (wxSProperty == wxT("KIND") && KindProcessed == FALSE){ + }/* if (wxSProperty == wxT("KIND") && KindProcessed == FALSE){ // See frmContactEditor-LoadGroup.cpp LoadKind(wxSPropertySeg2); - } else if (wxSProperty == wxT("MEMBER")){ + }*/ else if (wxSProperty == wxT("MEMBER")){ // See frmContactEditor-LoadGroup.cpp diff --git a/source/contacteditor/frmContactEditor-LoadGroup.cpp b/source/contacteditor/frmContactEditor-LoadGroup.cpp index 2ba020c..516b1cc 100644 --- a/source/contacteditor/frmContactEditor-LoadGroup.cpp +++ b/source/contacteditor/frmContactEditor-LoadGroup.cpp @@ -20,6 +20,34 @@ #include "../common/dirs.h" #include +void frmContactEditor::LoadKind(ContactKindType *KindType){ + + std::cerr << *KindType << std::endl; + + switch (*KindType){ + case CONTACTKIND_INDIVIDUAL: + cmbType->SetSelection(1); + break; + case CONTACTKIND_GROUP: + cmbType->SetSelection(2); + break; + case CONTACTKIND_ORGANISATION: + cmbType->SetSelection(3); + break; + case CONTACTKIND_LOCATION: + cmbType->SetSelection(4); + break; + case CONTACTKIND_NONE: + cmbType->SetSelection(0); + break; + } + + wxCommandEvent nullevent; + + UpdateMembersTab(nullevent); + +} + void frmContactEditor::LoadKind(wxString KindType){ if (KindType == wxT("individual")){ diff --git a/source/contacteditor/frmContactEditor.h b/source/contacteditor/frmContactEditor.h index 8b872b3..7ea6461 100644 --- a/source/contacteditor/frmContactEditor.h +++ b/source/contacteditor/frmContactEditor.h @@ -642,6 +642,7 @@ class frmContactEditor : public frmContactEditorADT void LoadGender(wxString *GenderComponent, wxString *GenderIdentity); void LoadBirthday(wxString *BirthdayData, bool *BirthdayText); void LoadAnniversary(wxString *AnniversaryData, bool *AnniversaryText); + void LoadKind(ContactKindType *KindType); int intValueSeek = 1; bool IsGroup = FALSE; -- 2.39.5