frmMainADT( parent )
{
- mainCalendarCtrl = new XCCalendarCtrl(this, &calendarData);
-
// Setup the default settings if they don't
// exist.
wxString prefDirectory = GetUserPrefDir();
preferences = new XCALPreferences(prefDirectory);
- szrMain->Add(mainCalendarCtrl, 1, wxEXPAND, 5);
- szrMain->Layout();
-
// Load the settings.
wxString fullPrefPath;
}
}
+
+ // Load the account data.
LoadAccountData();
+ // Setup the form control.
+
+ mainCalendarCtrl = new XCCalendarCtrl(this, &calendarData);
+ szrMain->Add(mainCalendarCtrl, 1, wxEXPAND, 5);
+ szrMain->Layout();
+
}
void frmMain::QuitApp( wxCloseEvent& event )
CDSGetCalendarInfo calendarInfo = calendarData.GetCalendar(string(preferences->accounts.GetAccountName(accountSeek).mb_str()), calendarList.calendarShortName[calendarSeek]);
calendarList.calendarStorageID[calendarSeek] = calendarInfo.calendarID;
+ // Find the entries and load each entry.
+
+ string calendarListDirectory = calendarListFilename;
+ calendarListDirectory += "/";
+ calendarListDirectory += calendarList.calendarShortName[calendarSeek];
+ calendarListDirectory += "/";
+
+ wxDir entryListDirectory(calendarListDirectory);
+ wxString entryListFilename;
+
+ bool continueProcessing = entryListDirectory.GetFirst(&entryListFilename, "*.ics", wxDIR_NO_FOLLOW|wxDIR_FILES);
+
+ while (continueProcessing){
+
+ string entryListFullFilename;
+ entryListFullFilename += calendarListDirectory;
+ entryListFullFilename += string(entryListFilename.mb_str());
+
+ continueProcessing = entryListDirectory.GetNext(&entryListFilename);
+ CDSAddEntryResult addEventResult = calendarData.AddEvent(calendarInfo.calendarID, entryListFullFilename);
+
+ }
+
}
}
+}
+
+void frmMain::ShowAboutWindow( wxCommandEvent& event )
+{
+
+ // Show the about window.
+
+ frmAbout *frameAbout = new frmAbout ( this );
+ frameAbout->SetupAboutWindow();
+ frameAbout->ShowModal();
+ delete frameAbout;
+ frameAbout = NULL;
+
}
\ No newline at end of file