From: Steve Brokenshire Date: Mon, 28 Dec 2015 19:43:17 +0000 (+0000) Subject: Introduced simplified LoadKind. X-Git-Tag: release-0.09~141 X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=commitdiff_plain;h=06c2ed8b03776fa476de5043a8c09e00d3a481f5 Introduced simplified LoadKind. --- 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;