}
calendarInfo->editMode = editMode;
- calendarInfo->accountName = cmbAccount->GetStringSelection();
- calendarInfo->calendarName = txtName->GetValue().ToStdString();
- calendarInfo->calendarDescription = txtDescription->GetValue().ToStdString();
+ calendarInfo->accountName = std::string(cmbAccount->GetStringSelection().ToUTF8());
+ calendarInfo->calendarName = std::string(txtName->GetValue().ToUTF8());
+ calendarInfo->calendarDescription = std::string(txtDescription->GetValue().ToUTF8());
calendarInfo->calendarColour = (clpColour->GetColour().GetAsString(wxC2S_HTML_SYNTAX).ToStdString() + "FF");
void frmCalendarEditor::SetData(int calendarID, std::string accountName, std::string calendarName, std::string calendarDescription, Colour calendarColour){
- txtName->SetValue(wxString(calendarName.c_str()));
- txtDescription->SetValue(wxString(calendarDescription.c_str()));
+ txtName->SetValue(wxString(calendarName.c_str(), wxConvUTF8));
+ txtDescription->SetValue(wxString(calendarDescription.c_str(), wxConvUTF8));
clpColour->SetColour(wxColour(calendarColour.red, calendarColour.green, calendarColour.blue));
- cmbAccount->SetStringSelection(wxString(accountName));
+ cmbAccount->SetStringSelection(wxString(accountName.c_str(), wxConvUTF8));
this->calendarID = calendarID;
}
\ No newline at end of file
CDSGetCalendarInfo calendarInfo = dataStorage->GetCalendar((*calendarSeek));
combinedName += calendarInfo.calendarName;
- cmbCalendar->Append((wxString)combinedName);
+ cmbCalendar->Append(wxString(combinedName.c_str(), wxConvUTF8));
calendarIDList.push_back(calendarInfo.calendarID);
}
// Load the data into the form.
- txtEventName->SetValue(wxString(eventInfo.entryName));
- txtEventDescription->SetValue(wxString(eventInfo.entryDescription));
+ txtEventName->SetValue(wxString(eventInfo.entryName.c_str(), wxConvUTF8));
+ txtEventDescription->SetValue(wxString(eventInfo.entryDescription.c_str(), wxConvUTF8));
// Load the start and end dates.
// Set the data into the calendar event object.
- eventData.summaryData = txtEventName->GetValue().ToStdString();
+ eventData.summaryData = string(txtEventName->GetValue().ToUTF8());
if (eventData.descriptionList.size() > 0)
{
- eventData.descriptionList[0] = txtEventDescription->GetValue().ToStdString();
+ eventData.descriptionList[0] = string(txtEventDescription->GetValue().ToUTF8());
}
else
{
- eventData.descriptionList.push_back(txtEventDescription->GetValue().ToStdString());
+ eventData.descriptionList.push_back(string(txtEventDescription->GetValue().ToUTF8()));
eventData.descriptionListAltRep.push_back("");
eventData.descriptionListLanguage.push_back("");
eventData.descriptionListTokens.push_back("");
}
- eventData.descriptionList.push_back(txtEventDescription->GetValue().ToStdString());
+ eventData.descriptionList.push_back(string(txtEventDescription->GetValue().ToUTF8()));
eventData.descriptionListAltRep.push_back("");
eventData.descriptionListLanguage.push_back("");
eventData.descriptionListTokens.push_back("");
CDSGetCalendarInfo calendarInfo = dataStorage->GetCalendar(calendarIDList[cmbCalendar->GetSelection()]);
CDSGetAccountInfo accountInfo = dataStorage->GetAccount(calendarInfo.accountName);
- string calendarDirectory = GetUserDir().ToStdString();
+ string calendarDirectory = string(GetUserDir().ToUTF8());
calendarDirectory += "accounts";
calendarDirectory += "/";
- calendarDirectory += preferences->accounts.GetAccountDirectory(accountInfo.accountPreferencesID).ToStdString();
+ calendarDirectory += string(preferences->accounts.GetAccountDirectory(accountInfo.accountPreferencesID).ToUTF8());
calendarDirectory += ".";
- calendarDirectory += preferences->accounts.GetAccountType(accountInfo.accountPreferencesID).ToStdString();
+ calendarDirectory += string(preferences->accounts.GetAccountType(accountInfo.accountPreferencesID).ToUTF8());
calendarDirectory += "/";
calendarDirectory += calendarInfo.calendarTextID;
calendarDirectory += "/";
// the main window.
EventProperties *eventInfo = new EventProperties;
- eventInfo->eventName = txtEventName->GetValue().ToStdString();
- eventInfo->eventDescipriton = txtEventDescription->GetValue().ToStdString();
+ eventInfo->eventName = string(txtEventName->GetValue().ToUTF8());
+ eventInfo->eventDescipriton = string(txtEventDescription->GetValue().ToUTF8());
eventInfo->calendarID = calendarIDList[cmbCalendar->GetSelection()];
eventInfo->eventID = addEventResult.calendarEntryID;
eventInfo->eventYear = dapStartDate->GetValue().GetYear();
// the main window.
EventProperties *eventInfo = new EventProperties;
- eventInfo->eventName = txtEventName->GetValue().ToStdString();
- eventInfo->eventDescipriton = txtEventDescription->GetValue().ToStdString();
+ eventInfo->eventName = string(txtEventName->GetValue().ToUTF8());
+ eventInfo->eventDescipriton = string(txtEventDescription->GetValue().ToUTF8());
eventInfo->calendarID = calendarID;
eventInfo->eventID = eventID;
eventInfo->eventYear = dapStartDate->GetValue().GetYear();
// Generate the window title.
- string windowTitle;
+ wxString windowTitle;
if (cmbCalendar->GetSelection() == -1)
{
}
else
{
- windowTitle += cmbCalendar->GetStringSelection().ToStdString();
+ windowTitle += cmbCalendar->GetStringSelection();
}
if (txtEventName->IsEmpty())
else
{
windowTitle += " - ";
- windowTitle += txtEventName->GetValue().ToStdString();
+ windowTitle += txtEventName->GetValue();
}
SetTitle(windowTitle);
for (int accountSeek = 0; accountSeek < accountCount; accountSeek++){
- CDSAccountResult addResult = calendarData.AddAccount(string(preferences->accounts.GetAccountName(accountSeek).mb_str()), accountSeek);
+ CDSAccountResult addResult = calendarData.AddAccount(string(preferences->accounts.GetAccountName(accountSeek).ToUTF8()), accountSeek);
}
for (int accountSeek = 0; accountSeek < accountCount; accountSeek++){
- CDSGetAccountInfo accountInfo = calendarData.GetAccount(string(preferences->accounts.GetAccountName(accountSeek).mb_str()));
+ CDSGetAccountInfo accountInfo = calendarData.GetAccount(string(preferences->accounts.GetAccountName(accountSeek).ToUTF8()));
// Build the path.
// Find the entries and load each entry.
- string calendarListDirectory = calendarListFilename;
+ wxString calendarListDirectory = wxString(calendarListFilename.c_str(), wxConvUTF8);
calendarListDirectory += "/";
- calendarListDirectory += calendarList.calendarShortName[calendarSeek];
+ calendarListDirectory += wxString(calendarList.calendarShortName[calendarSeek].c_str(), wxConvUTF8);
calendarListDirectory += "/";
wxDir entryListDirectory(calendarListDirectory);
while (continueProcessing){
string entryListFullFilename;
- entryListFullFilename += calendarListDirectory;
- entryListFullFilename += string(entryListFilename.mb_str());
+ entryListFullFilename += string(calendarListDirectory.ToUTF8());
+ entryListFullFilename += string(entryListFilename.ToUTF8());
continueProcessing = entryListDirectory.GetNext(&entryListFilename);
CDSAddEntryResult addEventResult = calendarData.AddEvent(calendarInfo.calendarID, entryListFullFilename);
accountDirectoryPath += "accounts/";
accountDirectoryPath += string(preferences->accounts.GetAccountDirectory(calendarEventInfo->accountPreferencesID).ToUTF8());
accountDirectoryPath += ".";
- accountDirectoryPath += string(preferences->accounts.GetAccountType(calendarEventInfo->accountPreferencesID).mb_str());
+ accountDirectoryPath += string(preferences->accounts.GetAccountType(calendarEventInfo->accountPreferencesID).ToUTF8());
accountDirectoryPath += "/";
string calendarListFilenameFull = accountDirectoryPath;
string calendarDirectoryPath = accountDirectoryPath;
calendarDirectoryPath += calendarInfo.calendarTextID;
- wxFileConfig *calendarListFile = new wxFileConfig("", "", wxString(calendarListFilenameFull));
+ wxFileConfig *calendarListFile = new wxFileConfig("", "", wxString(calendarListFilenameFull.c_str(), wxConvUTF8));
// Delete the calendar directory.
// Delete the calendar directory.
- //wxRmdir(wxString(calendarDirectoryPath.c_str(), wxConvUTF8));
+ wxRmDir(wxString(calendarDirectoryPath.c_str(), wxConvUTF8));
delete calendarListFile;
calendarListFile = nullptr;
CDSGetCalendarEntryInfo eventDeleteData = calendarData.GetEvent(eventInfo->eventID);
CDSGetCalendarInfo calendarDeleteData = calendarData.GetCalendar(eventInfo->calendarID);
- if (wxMessageBox(wxString::Format("Are you sure you want to delete the event %s from the %s calendar?", eventDeleteData.entryName, calendarDeleteData.calendarName), "Delete event", wxYES_NO|wxICON_QUESTION) == wxNO){
+ if (wxMessageBox(wxString::Format("Are you sure you want to delete the event %s from the %s calendar?", wxString(eventDeleteData.entryName.c_str(), wxConvUTF8), wxString(calendarDeleteData.calendarName.c_str(), wxConvUTF8)), "Delete event", wxYES_NO|wxICON_QUESTION) == wxNO){
return;
}
// Get the filename and delete the entry.
- wxRemoveFile(wxString(eventDeleteData.entryFilename.c_str()));
+ wxRemoveFile(wxString(eventDeleteData.entryFilename.c_str(), wxConvUTF8));
// Delete the entry from the calendar data storage.
wxString calendarListFilenameFull;
- calendarListFilenameFull.Append(calendarListFilename);
+ calendarListFilenameFull.Append(wxString(calendarListFilename.c_str(), wxConvUTF8));
calendarListFilenameFull.Append(wxT("/calendarlist.db"));
wxFileConfig *calendarListFile = new wxFileConfig("", "", calendarListFilenameFull);