Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
frmEventEditor: Set calendar ID when editing event
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 14 Feb 2017 01:33:54 +0000 (01:33 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Tue, 14 Feb 2017 01:33:54 +0000 (01:33 +0000)
source/forms/eventeditor/frmEventEditor.cpp
source/forms/eventeditor/frmEventEditor.h

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();
index 6673505..a1b5f0e 100644 (file)
@@ -51,6 +51,7 @@ class frmEventEditor : public frmEventEditorADT
                vector<int> calendarIDList;
                bool editMode = false;
                int eventID = 0;
+               int calendarID = 0;
                string eventFilePath;
                void SaveContact();
                XCALPreferences *preferences;
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