Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
utf8: Implemented further UTF8 support
[xestiacalendar/.git] / source / forms / main / frmMain.cpp
index 2f826de..11246ae 100644 (file)
@@ -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.
        
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