X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=blobdiff_plain;f=source%2Fforms%2Feventeditor%2FfrmEventEditor.cpp;h=ad9b1846008d2bb06d669c61ace5396244f23bb6;hp=dda8dd17ac2d4d872181169a3fdaac0ddf9f37f6;hb=8c3ffd801b8a316dcaf51f988002e324979d9bbd;hpb=616ddd1b189837e5a7d1d6953534115be44f477b diff --git a/source/forms/eventeditor/frmEventEditor.cpp b/source/forms/eventeditor/frmEventEditor.cpp index dda8dd1..ad9b184 100644 --- a/source/forms/eventeditor/frmEventEditor.cpp +++ b/source/forms/eventeditor/frmEventEditor.cpp @@ -159,7 +159,10 @@ void frmEventEditor::SaveContact(wxCommandEvent &event){ void frmEventEditor::SaveNewContact(wxCommandEvent &event){ - SaveContact(); + if (!SaveContact()) + { + return; + } // Reset the form for a new entry. @@ -180,14 +183,14 @@ void frmEventEditor::SaveNewContact(wxCommandEvent &event){ } -void frmEventEditor::SaveContact(){ +bool frmEventEditor::SaveContact(){ // Verify that a calendar has been selected. if (cmbCalendar->GetSelection() == -1 && editMode == false){ wxMessageBox("Please select a calendar for this entry.", "No calendar selected", wxOK); - return; + return false; } @@ -196,7 +199,7 @@ void frmEventEditor::SaveContact(){ if (txtEventName->GetValue().IsEmpty()){ wxMessageBox("The event name cannot be left empty.", "Event name is empty", wxOK); - return; + return false; } @@ -222,6 +225,19 @@ void frmEventEditor::SaveContact(){ // Set the data into the calendar event object. eventData.summaryData = txtEventName->GetValue().ToStdString(); + + if (eventData.descriptionList.size() > 0) + { + eventData.descriptionList[0] = txtEventDescription->GetValue().ToStdString(); + } + else + { + eventData.descriptionList.push_back(txtEventDescription->GetValue().ToStdString()); + eventData.descriptionListAltRep.push_back(""); + eventData.descriptionListLanguage.push_back(""); + eventData.descriptionListTokens.push_back(""); + } + eventData.descriptionList.push_back(txtEventDescription->GetValue().ToStdString()); eventData.descriptionListAltRep.push_back(""); eventData.descriptionListLanguage.push_back(""); @@ -294,6 +310,7 @@ void frmEventEditor::SaveContact(){ EventProperties *eventInfo = new EventProperties; eventInfo->eventName = txtEventName->GetValue().ToStdString(); + eventInfo->eventDescipriton = txtEventDescription->GetValue().ToStdString(); eventInfo->calendarID = calendarIDList[cmbCalendar->GetSelection()]; eventInfo->eventID = addEventResult.calendarEntryID; eventInfo->eventYear = dapStartDate->GetValue().GetYear(); @@ -341,6 +358,7 @@ void frmEventEditor::SaveContact(){ EventProperties *eventInfo = new EventProperties; eventInfo->eventName = txtEventName->GetValue().ToStdString(); + eventInfo->eventDescipriton = txtEventDescription->GetValue().ToStdString(); eventInfo->calendarID = calendarID; eventInfo->eventID = eventID; eventInfo->eventYear = dapStartDate->GetValue().GetYear(); @@ -357,6 +375,8 @@ void frmEventEditor::SaveContact(){ } + return true; + } void frmEventEditor::CloseWindow(wxCommandEvent &event) @@ -574,4 +594,4 @@ void frmEventEditor::UpdateWindowName() updateEvent.SetClientData(updateWindowData); wxPostEvent(this->GetParent(), updateEvent); -} \ No newline at end of file +}