NameData.Title = txtTitle->GetValue();
NameData.Suffix = txtSuffix->GetValue();
- ucd->ContactAccount = wxSContactAccount;
- ucd->ContactFilename = FilenameFinal;
- ucd->ContactName = cmbDisplayAs->GetValue();
- ucd->ContactNameArray = NameData;
+ if (this->GetParent() != nullptr)
+ {
+ ucd->ContactAccount = wxSContactAccount;
+ ucd->ContactFilename = FilenameFinal;
+ ucd->ContactName = cmbDisplayAs->GetValue();
+ ucd->ContactNameArray = NameData;
- for (std::map<int,wxString>::iterator gniter = ContactEditorData.GeneralNicknamesList.begin();
- gniter != ContactEditorData.GeneralNicknamesList.end(); gniter++){
+ for (std::map<int,wxString>::iterator gniter = ContactEditorData.GeneralNicknamesList.begin();
+ gniter != ContactEditorData.GeneralNicknamesList.end(); gniter++){
- ucd->ContactNickname = gniter->second;
- break;
+ ucd->ContactNickname = gniter->second;
+ break;
+ }
+
+ wxCommandEvent event2(CE_UPDATECONTACTLIST);
+ event2.SetClientData(ucd);
+ wxPostEvent(MainPtr, event2);
}
- wxCommandEvent event2(CE_UPDATECONTACTLIST);
- event2.SetClientData(ucd);
- wxPostEvent(MainPtr, event2);
-
}
void frmContactEditor::SaveCloseContact( wxCommandEvent& event )