Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
utf8: Implemented further UTF8 support
[xestiacalendar/.git] / source / forms / eventeditor / frmEventEditor.cpp
index ad9b184..52e4d2d 100644 (file)
@@ -53,7 +53,7 @@ void frmEventEditor::SetupForm(CalendarDataStorage *dataStorage, XCALPreferences
                        CDSGetCalendarInfo calendarInfo = dataStorage->GetCalendar((*calendarSeek));
                                
                        combinedName += calendarInfo.calendarName;
-                       cmbCalendar->Append((wxString)combinedName);
+                       cmbCalendar->Append(wxString(combinedName.c_str(), wxConvUTF8));
                        calendarIDList.push_back(calendarInfo.calendarID);
                                
                }
@@ -87,8 +87,8 @@ void frmEventEditor::SetupForm(CalendarDataStorage *dataStorage, XCALPreferences
                
                // 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.
                
@@ -224,21 +224,21 @@ bool frmEventEditor::SaveContact(){
        
        // 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("");
@@ -281,12 +281,12 @@ bool frmEventEditor::SaveContact(){
                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 += "/";
@@ -309,8 +309,8 @@ bool frmEventEditor::SaveContact(){
                // 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();
@@ -357,8 +357,8 @@ bool frmEventEditor::SaveContact(){
                // 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();
@@ -549,7 +549,7 @@ void frmEventEditor::UpdateWindowName()
        
        // Generate the window title.
        
-       string windowTitle;
+       wxString windowTitle;
        
        if (cmbCalendar->GetSelection() == -1)
        {
@@ -557,7 +557,7 @@ void frmEventEditor::UpdateWindowName()
        }
        else
        {
-               windowTitle += cmbCalendar->GetStringSelection().ToStdString();
+               windowTitle += cmbCalendar->GetStringSelection();
        }
        
        if (txtEventName->IsEmpty())
@@ -568,7 +568,7 @@ void frmEventEditor::UpdateWindowName()
        else
        {
                windowTitle += " - ";
-               windowTitle += txtEventName->GetValue().ToStdString();
+               windowTitle += txtEventName->GetValue();
        }
        
        SetTitle(windowTitle);
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