X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=blobdiff_plain;f=source%2Fforms%2Feventeditor%2FfrmEventEditor.cpp;h=4c95dc30e282167d3b50108aeab3f910ae5527a6;hp=79f5831a4e452b0d49d0b254c7e89f799c2c61f2;hb=e5e8bdcfe81d4184b57623167b55cd6bdab9fe90;hpb=b604cc6ce09143a994ca364684cd276f78bd33da diff --git a/source/forms/eventeditor/frmEventEditor.cpp b/source/forms/eventeditor/frmEventEditor.cpp index 79f5831..4c95dc3 100644 --- a/source/forms/eventeditor/frmEventEditor.cpp +++ b/source/forms/eventeditor/frmEventEditor.cpp @@ -66,13 +66,17 @@ void frmEventEditor::SetupForm(CalendarDataStorage *dataStorage, XCALPreferences CDSGetCalendarEntryInfo eventInfo = dataStorage->GetEvent(eventID); + // Set the calendar ID. + + calendarID = eventInfo.calendarID; + // Load the calendar info. cmbCalendar->Show(false); lblCalendar->Show(false); szrDetails->Layout(); - szrList->Layout(); + szrList->Layout(); // Load the data into the form. @@ -295,6 +299,7 @@ void frmEventEditor::SaveContact(){ eventFilePath = eventFile; editMode = true; + calendarID = eventInfo->calendarID; eventID = addEventResult.calendarEntryID; @@ -325,7 +330,7 @@ void frmEventEditor::SaveContact(){ EventProperties *eventInfo = new EventProperties; eventInfo->eventName = txtEventName->GetValue().ToStdString(); - eventInfo->calendarID = calendarIDList[cmbCalendar->GetSelection()]; + eventInfo->calendarID = calendarID; eventInfo->eventID = eventID; eventInfo->eventYear = dapStartDate->GetValue().GetYear(); eventInfo->eventMonth = dapStartDate->GetValue().GetMonth();