Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmEventEditor: Set calendar ID when editing event
[xestiacalendar/.git] / source / forms / eventeditor / frmEventEditor.cpp
index 79f5831..4c95dc3 100644 (file)
@@ -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();
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy