dolphinwx and debuggerwx can now be compiled with unicode

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3906 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99
2009-07-30 07:09:26 +00:00
parent 90d2d95c72
commit 8302ac84de
15 changed files with 84 additions and 63 deletions

View File

@ -272,25 +272,24 @@ void CConfigMain::CreateGUIControls()
Theme->SetSelection(SConfig::GetInstance().m_LocalCoreStartupParameter.iTheme);
// ToolTips
UseDynaRec->SetToolTip(wxT("Disabling this will cause Dolphin to run in interpreter mode,"
"\nwhich can be more accurate, but is MUCH slower"));
UseDynaRec->SetToolTip(wxT("Disabling this will cause Dolphin to run in interpreter mode,")
wxT("\nwhich can be more accurate, but is MUCH slower"));
ConfirmStop->SetToolTip(wxT("Show a confirmation box before stopping a game."));
UsePanicHandlers->SetToolTip(wxT("Show a message box when a potentially serious error has occured."
" Disabling this may avoid annoying and non-fatal messages, but it may also mean that Dolphin"
" suddenly crashes without any explanation at all."
));
UsePanicHandlers->SetToolTip(wxT("Show a message box when a potentially serious error has occured.")
wxT(" Disabling this may avoid annoying and non-fatal messages, but it may also mean that Dolphin")
wxT(" suddenly crashes without any explanation at all."));
AutoHideCursor->SetToolTip(wxT("This will auto hide the cursor in fullscreen mode."));
HideCursor->SetToolTip(wxT("This will always hide the cursor when it's over the rendering window."
"\nIt can be convenient in a Wii game that already has a cursor."));
HideCursor->SetToolTip(wxT("This will always hide the cursor when it's over the rendering window.")
wxT("\nIt can be convenient in a Wii game that already has a cursor."));
WiimoteStatusLEDs->SetToolTip(wxT("Show which wiimotes are connected in the statusbar."));
WiimoteStatusSpeakers->SetToolTip(wxT("Show wiimote speaker status in the statusbar."));
DSPThread->SetToolTip(wxT("This should be on when using HLE and off when using LLE."));
UseDualCore->SetToolTip(wxT("This splits the Video and CPU threads, so they can be run on separate cores."
"\nCauses major speed improvements on PCs with more than one core,"
"\nbut can also cause occasional crashes/glitches."));
UseDualCore->SetToolTip(wxT("This splits the Video and CPU threads, so they can be run on separate cores.")
wxT("\nCauses major speed improvements on PCs with more than one core,")
wxT("\nbut can also cause occasional crashes/glitches."));
InterfaceLang->SetToolTip(wxT("For the time being this will only change the text shown in"
"\nthe game list of PAL GC games."));
InterfaceLang->SetToolTip(wxT("For the time being this will only change the text shown in")
wxT("\nthe game list of PAL GC games."));
// Copyright notice
Theme->SetItemToolTip(0, wxT("Created by Milosz Wlazlo [miloszwl@miloszwl.com, miloszwl.deviantart.com]"));
Theme->SetItemToolTip(1, wxT("Created by VistaIcons.com"));
@ -728,7 +727,7 @@ void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA)
{
std::string filename = std::string(wxFileSelector(
wxT("Choose a file to open"),
wxT(FULL_GC_USER_DIR),
T_FULL_GC_USER_DIR,
isSlotA ? wxT(GC_MEMCARDA) : wxT(GC_MEMCARDB),
wxEmptyString,
wxT("Gamecube Memory Cards (*.raw,*.gcp)|*.raw;*.gcp")).mb_str());

View File

@ -431,7 +431,7 @@ void CFrame::OnOpen(wxCommandEvent& WXUNUSED (event))
void CFrame::DoOpen(bool Boot)
{
std::string currentDir = File::GetCurrentDirectory();
std::string currentDir = File::GetCurrentDir();
wxString path = wxFileSelector(
_T("Select the file to load"),
@ -447,12 +447,12 @@ void CFrame::DoOpen(bool Boot)
bool fileChosen = !path.IsEmpty();
std::string currentDir2 = File::GetCurrentDirectory();
std::string currentDir2 = File::GetCurrentDir();
if (currentDir != currentDir2)
{
PanicAlert("Current dir changed from %s to %s after wxFileSelector!",currentDir.c_str(),currentDir2.c_str());
File::SetCurrentDirectory(currentDir.c_str());
File::SetCurrentDir(currentDir.c_str());
}

View File

@ -330,18 +330,17 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
SetItem(_Index, COLUMN_TITLE, name, -1);
if (CopySJISToString(description, rISOFile.GetDescription(0).c_str()))
SetItem(_Index, COLUMN_NOTES, description, -1);
m_gameList.append(std::string(name.mb_str()) + " (J)\n");
m_gameList.append(StringFromFormat("%s (J)\n", (const char*)name.mb_str(wxConvUTF8)));
break;
case DiscIO::IVolume::COUNTRY_USA:
if (CopySJISToString(name, rISOFile.GetName(0).c_str()))
SetItem(_Index, COLUMN_TITLE, name, -1);
if (CopySJISToString(description, rISOFile.GetDescription(0).c_str()))
SetItem(_Index, COLUMN_NOTES, description, -1);
m_gameList.append(std::string(name.mb_str()) + " (U)\n");
m_gameList.append(StringFromFormat("%s (U)\n", (const char*)name.mb_str(wxConvUTF8)));
break;
default:
m_gameList.append(std::string(
wxString::From8BitData(rISOFile.GetName((int)SConfig::GetInstance().m_InterfaceLanguage).c_str()).mb_str()) + " (E)\n");
m_gameList.append(StringFromFormat("%s (E)\n", rISOFile.GetName((int)SConfig::GetInstance().m_InterfaceLanguage).c_str()));
SetItem(_Index, COLUMN_TITLE,
wxString::From8BitData(rISOFile.GetName((int)SConfig::GetInstance().m_InterfaceLanguage).c_str()), -1);
SetItem(_Index, COLUMN_NOTES,
@ -1081,6 +1080,11 @@ bool CGameListCtrl::CopySJISToString( wxString& _rDestination, const char* _src
_src, (int)strlen(_src),
(LPWSTR)pUnicodeStrBuffer, unicodeNameSize))
{
#ifdef _UNICODE
_rDestination = (LPWSTR)pUnicodeStrBuffer;
returnCode = true;
#else
u32 ansiNameSize = WideCharToMultiByte(CP_ACP, 0,
(LPCWSTR)pUnicodeStrBuffer, unicodeNameSize,
NULL, NULL, NULL, NULL);
@ -1100,6 +1104,7 @@ bool CGameListCtrl::CopySJISToString( wxString& _rDestination, const char* _src
delete pAnsiStrBuffer;
}
}
#endif
}
delete pUnicodeStrBuffer;
}

View File

@ -1,4 +1,4 @@
// Copyright (C) 2003 Dolphin Project.
// Copyright (C) 2003-2009 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -23,6 +23,7 @@
#include "PatchAddEdit.h"
#include "ARCodeAddEdit.h"
#include "ConfigManager.h"
#include "StringUtil.h"
struct WiiPartition
{
@ -190,7 +191,9 @@ CISOProperties::CISOProperties(const std::string fileName, wxWindow* parent, wxW
wxString name;
CopySJISToString(name, OpenGameListItem->GetName(0).c_str());
SetTitle(wxString::Format(_("%s%s: %s - %s"), filename.c_str(), extension.c_str(), OpenGameListItem->GetUniqueID().c_str(), name.c_str()));
SetTitle(wxString::Format(wxT("%s%s"),
wxString::FromAscii(StringFromFormat("%s%s: %s - ", filename.c_str(), extension.c_str(), OpenGameListItem->GetUniqueID().c_str()).c_str()),
name.c_str()).c_str());
}
CISOProperties::~CISOProperties()
@ -792,7 +795,7 @@ bool CISOProperties::SaveGameConfig()
else
GameIni.Set("EmuState", "EmulationStateId", EmuState->GetSelection());
GameIni.Set("EmuState", "EmulationIssues", EmuIssues->GetValue());
GameIni.Set("EmuState", "EmulationIssues", (const char*)EmuIssues->GetValue().mb_str(wxConvUTF8));
PatchList_Save();
ActionReplayList_Save();
@ -1032,6 +1035,10 @@ bool CISOProperties::CopySJISToString( wxString& _rDestination, const char* _src
_src, (int)strlen(_src),
(LPWSTR)pUnicodeStrBuffer, unicodeNameSize))
{
#ifdef _UNICODE
_rDestination = (LPWSTR)pUnicodeStrBuffer;
returnCode = true;
#else
u32 ansiNameSize = WideCharToMultiByte(CP_ACP, 0,
(LPCWSTR)pUnicodeStrBuffer, unicodeNameSize,
NULL, NULL, NULL, NULL);
@ -1051,6 +1058,7 @@ bool CISOProperties::CopySJISToString( wxString& _rDestination, const char* _src
delete pAnsiStrBuffer;
}
}
#endif
}
delete pUnicodeStrBuffer;
}

View File

@ -241,7 +241,7 @@ void CMemcardManager::CreateGUIControls()
sPages[slot]->Add(0, 0, 1, wxEXPAND|wxALL, 0);
sPages[slot]->Add(m_NextPage[slot], 0, wxEXPAND|wxALL, 1);
m_MemcardPath[slot] = new wxFilePickerCtrl(this, ID_MEMCARDPATH_A + slot, wxT(FULL_GC_USER_DIR), wxT("Choose a memory card:"),
m_MemcardPath[slot] = new wxFilePickerCtrl(this, ID_MEMCARDPATH_A + slot, T_FULL_GC_USER_DIR, wxT("Choose a memory card:"),
wxT("Gamecube Memory Cards (*.raw,*.gcp)|*.raw;*.gcp"), wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL|wxFLP_OPEN);
m_MemcardList[slot] = new CMemcardListCtrl(this, ID_MEMCARDLIST_A + slot, wxDefaultPosition, wxSize(350,400),
@ -553,13 +553,13 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
slot = SLOT_A;
case ID_SAVEIMPORT_B:
{
wxString temp = wxFileSelector(_T("Select a save file to import"),
wxString temp = wxFileSelector(wxT("Select a save file to import"),
(strcmp(DefaultIOPath.c_str(), "/Users/GC") == 0) ? wxString::FromAscii(""): wxString::FromAscii(DefaultIOPath.c_str()), wxEmptyString, wxEmptyString, wxString::Format
(
_T("Gamecube save files(*.gci,*.gcs,*.sav)|*.gci;*.gcs;*.sav|"
"Native GCI files (*.gci)|*.gci|"
"MadCatz Gameshark files(*.gcs)|*.gcs|"
"Datel MaxDrive/Pro files(*.sav)|*.sav"),
wxT("Gamecube save files(*.gci,*.gcs,*.sav)|*.gci;*.gcs;*.sav|")
wxT("Native GCI files (*.gci)|*.gci|")
wxT("MadCatz Gameshark files(*.gcs)|*.gcs|")
wxT("Datel MaxDrive/Pro files(*.sav)|*.sav"),
wxFileSelectorDefaultWildcardStr,
wxFileSelectorDefaultWildcardStr
),
@ -567,10 +567,10 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
const char * fileName = temp.ToAscii();
if (!temp.empty() && !fileName2.empty())
{
wxString temp2 = wxFileSelector(_T("Save GCI as.."),
wxEmptyString, wxEmptyString, _T(".gci"), wxString::Format
wxString temp2 = wxFileSelector(wxT("Save GCI as.."),
wxEmptyString, wxEmptyString, wxT(".gci"), wxString::Format
(
_T("GCI File(*.gci)|*.gci"),
wxT("GCI File(*.gci)|*.gci"),
wxFileSelectorDefaultWildcardStr,
wxFileSelectorDefaultWildcardStr
),
@ -595,12 +595,12 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
memoryCard[slot]->DEntry_GameCode(index,tempC);
memoryCard[slot]->DEntry_FileName(index,tempC2);
sprintf(tempC, "%s_%s.gci", tempC, tempC2);
wxString temp = wxFileSelector(_T("Export save as.."), wxString::FromAscii(DefaultIOPath.c_str()),
wxString::FromAscii(tempC), _T(".gci"), wxString::Format
wxString temp = wxFileSelector(wxT("Export save as.."), wxString::FromAscii(DefaultIOPath.c_str()),
wxString::FromAscii(tempC), wxT(".gci"), wxString::Format
(
_T("Native GCI files (*.gci)|*.gci|"
"MadCatz Gameshark files(*.gcs)|*.gcs|"
"Datel MaxDrive/Pro files(*.sav)|*.sav"),
wxT("Native GCI files (*.gci)|*.gci|")
wxT("MadCatz Gameshark files(*.gcs)|*.gcs|")
wxT("Datel MaxDrive/Pro files(*.sav)|*.sav"),
wxFileSelectorDefaultWildcardStr,
wxFileSelectorDefaultWildcardStr
),

View File

@ -55,8 +55,8 @@ void NetPlay::OnNetEvent(wxCommandEvent& event)
else
{
m_numClients--;
AppendText( wxString::Format(wxT("ERROR : Network Error !\n"
"*Player : %s has been dropped from the game.\n\n"),
AppendText( wxString::Format(wxT("ERROR : Network Error !\n")
wxT("*Player : %s has been dropped from the game.\n\n"),
(const char *)event.GetString().mb_str()) );
}
}
@ -154,8 +154,8 @@ void NetPlay::LoadGame()
// Sleep a bit to start the game at more or less the same time than the peer
wxMilliSleep(fping/2);
m_Logging->AppendText(wxString::Format(wxT("** Everyone is ready... Loading Game ! **\n"
"** Ping to client(s) is : %f ms\n"), fping));
m_Logging->AppendText(wxString::Format(wxT("** Everyone is ready... Loading Game ! **\n")
wxT("** Ping to client(s) is : %f ms\n"), fping));
}
else
m_Logging->AppendText(_("** Everyone is ready... Loading Game ! **\n"));
@ -200,9 +200,7 @@ bool NetPlay::GetNetPads(u8 padnb, SPADStatus PadStatus, u32 *netValues)
{
if (m_numClients < 1)
{
m_Logging->AppendText(_("** WARNING : "
"Ping too high (>2000ms) or connection lost ! \n"
"** WARNING : Stopping Netplay... \n"));
m_Logging->AppendText(_("** WARNING : Ping too high (>2000ms) or connection lost ! \n** WARNING : Stopping Netplay... \n"));
NetClass_ptr = NULL;
return false;
}
@ -302,9 +300,7 @@ bool NetPlay::GetNetPads(u8 padnb, SPADStatus PadStatus, u32 *netValues)
else {
if (m_loopframe > 126)
{
m_Logging->AppendText(_("** WARNING : "
"Ping too high (>2000ms) or connection lost ! \n"
"** WARNING : Stopping Netplay... \n"));
m_Logging->AppendText(_("** WARNING : Ping too high (>2000ms) or connection lost ! \n** WARNING : Stopping Netplay... \n"));
NetClass_ptr = NULL;
}

View File

@ -414,8 +414,7 @@ void *ClientSide::Entry()
}
else
{
Event->AppendText(_("UDP Connection FAILED !\n"
"ERROR : Unable to establish UDP Connection, please Check UDP Port forwarding !"));
Event->AppendText(_("UDP Connection FAILED !\nERROR : Unable to establish UDP Connection, please Check UDP Port forwarding !"));
m_socket.Close();
Event->SendEvent(HOST_ERROR);
return NULL;

View File

@ -143,8 +143,8 @@ void NetPlay::OnHost(wxCommandEvent& WXUNUSED(event))
// Create the GUI
m_isHosting = true;
DrawNetWindow();
m_Logging->AppendText(wxString::Format(wxT("WARNING : Hosting requires port to be forwarded in firewall!\n"
"*Creation Successful on port %d : Waiting for peers...\n"), m_port));
m_Logging->AppendText(wxString::Format(wxT("WARNING : Hosting requires port to be forwarded in firewall!\n")
wxT("*Creation Successful on port %d : Waiting for peers...\n"), m_port));
}
else
{