X-Git-Url: http://Server1/repobrowser/?p=xestiacalendar%2F.git;a=blobdiff_plain;f=source%2Fforms%2Fmain%2FfrmMain.cpp;h=11246aedffd42caff1f6adeed7234f452d064ad3;hp=2f826de0ebc462842c4a7b524a6a04b44a2277b5;hb=a191ad71a0d6823b9710067c7cccf8905290dc9c;hpb=4ee1691d79d18f5a702f25e3ace79d4ab6049e23 diff --git a/source/forms/main/frmMain.cpp b/source/forms/main/frmMain.cpp index 2f826de..11246ae 100644 --- a/source/forms/main/frmMain.cpp +++ b/source/forms/main/frmMain.cpp @@ -199,7 +199,7 @@ void frmMain::LoadAccountData(){ 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); } @@ -207,7 +207,7 @@ void frmMain::LoadAccountData(){ 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. @@ -240,9 +240,9 @@ void frmMain::LoadAccountData(){ // 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); @@ -253,8 +253,8 @@ void frmMain::LoadAccountData(){ 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); @@ -454,7 +454,7 @@ void frmMain::DeleteCalendar( wxCommandEvent& event ) 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; @@ -463,7 +463,7 @@ void frmMain::DeleteCalendar( wxCommandEvent& event ) 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. @@ -497,7 +497,7 @@ void frmMain::DeleteCalendar( wxCommandEvent& event ) // Delete the calendar directory. - //wxRmdir(wxString(calendarDirectoryPath.c_str(), wxConvUTF8)); + wxRmDir(wxString(calendarDirectoryPath.c_str(), wxConvUTF8)); delete calendarListFile; calendarListFile = nullptr; @@ -566,7 +566,7 @@ void frmMain::DeleteEvent( wxCommandEvent& event ){ 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; } @@ -579,7 +579,7 @@ void frmMain::DeleteEvent( wxCommandEvent& event ){ // 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.