From 6b58952dd564656cb93211f78748bb4d03bca0e7 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Sun, 14 Jan 2018 17:16:42 +0000 Subject: [PATCH] frmContactEditor: Check if there is values in certain text boxes Check for a value in either the Title, Forename, Surname, Other Names or Suffix boxes before saving. This is to provide better vCard 3.0 compatability --- source/contacteditor/frmContactEditor-Save.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/contacteditor/frmContactEditor-Save.cpp b/source/contacteditor/frmContactEditor-Save.cpp index 9018943..baeeae5 100644 --- a/source/contacteditor/frmContactEditor-Save.cpp +++ b/source/contacteditor/frmContactEditor-Save.cpp @@ -50,6 +50,19 @@ void frmContactEditor::SaveContact( wxCommandEvent& event ) } + // Check if a value has been entered either in the Title, + // Forename, Surname, Other Names and Suffix text boxes. + + if (txtTitle->IsEmpty() && txtForename->IsEmpty() && txtSurname->IsEmpty() + && txtOtherNames->IsEmpty() && txtSuffix->IsEmpty()) + { + + wxMessageBox(_("A value must be as minimum eithered in either the Title, Forename, Surname, Other Names or Suffix text boxes."), _("No name information entered"), wxICON_ERROR); + saveSuccess = false; + return; + + } + // Save the updated contact data. //vCard ContactData; -- 2.39.2