Attempt to be consistent with conversions between std::string and wxString.

This commit is contained in:
Jordan Woyak
2013-02-28 02:30:05 -06:00
parent e82d976d2f
commit 56f09d3b91
39 changed files with 344 additions and 300 deletions
+6 -5
View File
@@ -17,6 +17,7 @@
#include "ARCodeAddEdit.h"
#include "ARDecrypt.h"
#include "WxUtils.h"
extern std::vector<ActionReplay::ARCode> arCodes;
@@ -38,7 +39,7 @@ CARCodeAddEdit::CARCodeAddEdit(int _selection, wxWindow* parent, wxWindowID id,
}
else
{
currentName = wxString(arCodes.at(selection).name.c_str(), *wxConvCurrent);
currentName = StrToWxStr(arCodes.at(selection).name);
tempEntries = arCodes.at(selection);
}
@@ -73,7 +74,7 @@ CARCodeAddEdit::CARCodeAddEdit(int _selection, wxWindow* parent, wxWindowID id,
void CARCodeAddEdit::ChangeEntry(wxSpinEvent& event)
{
ActionReplay::ARCode currentCode = arCodes.at((int)arCodes.size() - event.GetPosition());
EditCheatName->SetValue(wxString(currentCode.name.c_str(), *wxConvCurrent));
EditCheatName->SetValue(StrToWxStr(currentCode.name));
UpdateTextCtrl(currentCode);
}
@@ -84,7 +85,7 @@ void CARCodeAddEdit::SaveCheatData(wxCommandEvent& WXUNUSED (event))
// Split the entered cheat into lines.
std::vector<std::string> userInputLines;
SplitString(std::string(EditCheatCode->GetValue().mb_str()), '\n', userInputLines);
SplitString(WxStrToStr(EditCheatCode->GetValue()), '\n', userInputLines);
for (size_t i = 0; i < userInputLines.size(); i++)
{
@@ -148,7 +149,7 @@ void CARCodeAddEdit::SaveCheatData(wxCommandEvent& WXUNUSED (event))
// Add a new AR cheat code.
ActionReplay::ARCode newCheat;
newCheat.name = std::string(EditCheatName->GetValue().mb_str());
newCheat.name = WxStrToStr(EditCheatName->GetValue());
newCheat.ops = decryptedLines;
newCheat.active = true;
@@ -157,7 +158,7 @@ void CARCodeAddEdit::SaveCheatData(wxCommandEvent& WXUNUSED (event))
else
{
// Update the currently-selected AR cheat code.
arCodes.at(selection).name = std::string(EditCheatName->GetValue().mb_str());
arCodes.at(selection).name = WxStrToStr(EditCheatName->GetValue());
arCodes.at(selection).ops = decryptedLines;
}
+2 -1
View File
@@ -17,6 +17,7 @@
#include "Common.h"
#include "AboutDolphin.h"
#include "WxUtils.h"
#include "../resources/dolphin_logo.cpp"
#include "scmrev.h"
@@ -62,7 +63,7 @@ AboutDolphin::AboutDolphin(wxWindow *parent, wxWindowID id,
"and should not be used to play games you do\n"
"not legally own.";
wxStaticText* const Message = new wxStaticText(this, wxID_ANY,
wxString::FromAscii(Text.c_str()));
StrToWxStr(Text.c_str()));
Message->Wrap(GetSize().GetWidth());
wxBoxSizer* const sInfo = new wxBoxSizer(wxVERTICAL);
+7 -6
View File
@@ -24,6 +24,7 @@
#include "ISOProperties.h"
#include "HW/Memmap.h"
#include "Frame.h"
#include "WxUtils.h"
#define MAX_CHEAT_SEARCH_RESULTS_DISPLAY 256
@@ -273,7 +274,7 @@ void wxCheatsWindow::Load_ARCodes()
{
ARCode code = GetARCode(i);
ARCodeIndex ind;
u32 index = m_CheckListBox_CheatsList->Append(wxString(code.name.c_str(), *wxConvCurrent));
u32 index = m_CheckListBox_CheatsList->Append(StrToWxStr(code.name));
m_CheckListBox_CheatsList->Check(index, code.active);
ind.index = i;
ind.uiIndex = index;
@@ -291,18 +292,18 @@ void wxCheatsWindow::OnEvent_CheatsList_ItemSelected(wxCommandEvent& WXUNUSED (e
if ((int)indexList[i].uiIndex == index)
{
ARCode code = GetARCode(i);
m_Label_Codename->SetLabel(_("Name: ") + wxString(code.name.c_str(), *wxConvCurrent));
m_Label_Codename->SetLabel(_("Name: ") + StrToWxStr(code.name));
char text[CHAR_MAX];
char* numcodes = text;
sprintf(numcodes, "Number of Codes: %lu", (unsigned long)code.ops.size());
m_Label_NumCodes->SetLabel(wxString::FromAscii(numcodes));
m_Label_NumCodes->SetLabel(StrToWxStr(numcodes));
m_ListBox_CodesList->Clear();
for (size_t j = 0; j < code.ops.size(); j++)
{
char text2[CHAR_MAX];
char* ops = text2;
sprintf(ops, "%08x %08x", code.ops[j].cmd_addr, code.ops[j].value);
m_ListBox_CodesList->Append(wxString::FromAscii(ops));
m_ListBox_CodesList->Append(StrToWxStr(ops));
}
}
}
@@ -347,7 +348,7 @@ void wxCheatsWindow::OnEvent_ButtonUpdateLog_Press(wxCommandEvent& WXUNUSED (eve
const std::vector<std::string> &arLog = ActionReplay::GetSelfLog();
for (u32 i = 0; i < arLog.size(); i++)
{
m_TextCtrl_Log->AppendText(wxString::FromAscii(arLog[i].c_str()));
m_TextCtrl_Log->AppendText(StrToWxStr(arLog[i].c_str()));
}
}
@@ -619,7 +620,7 @@ void CreateCodeDialog::PressOK(wxCommandEvent& ev)
// create the new code
ActionReplay::ARCode new_cheat;
new_cheat.active = false;
new_cheat.name = std::string(code_name.ToAscii());
new_cheat.name = WxStrToStr(code_name);
const ActionReplay::AREntry new_entry(code_address, code_value);
new_cheat.ops.push_back(new_entry);
+21 -21
View File
@@ -33,6 +33,7 @@
#include "IPC_HLE/WII_IPC_HLE.h"
#include "NANDContentLoader.h"
#include "WxUtils.h"
#include "Globals.h" // Local
#include "ConfigMain.h"
#include "ConfigManager.h"
@@ -100,7 +101,6 @@ static const wxLanguage langIds[] =
#define EXIDEV_AM_BB_STR _trans("AM-Baseboard")
#define EXIDEV_GECKO_STR "USBGecko"
#define CSTR_TRANS(a) wxString(wxGetTranslation(wxT(a))).mb_str()
#define WXSTR_TRANS(a) wxString(wxGetTranslation(wxT(a)))
#ifdef WIN32
//only used with xgettext to be picked up as translatable string.
@@ -188,7 +188,7 @@ CConfigMain::CConfigMain(wxWindow* parent, wxWindowID id, const wxString& title,
// Update selected ISO paths
for(u32 i = 0; i < SConfig::GetInstance().m_ISOFolder.size(); i++)
{
ISOPaths->Append(wxString(SConfig::GetInstance().m_ISOFolder[i].c_str(), *wxConvCurrent));
ISOPaths->Append(StrToWxStr(SConfig::GetInstance().m_ISOFolder[i]));
}
}
@@ -477,10 +477,10 @@ void CConfigMain::InitializeGUIValues()
// Paths
RecursiveISOPath->SetValue(SConfig::GetInstance().m_RecursiveISOFolder);
DefaultISO->SetPath(wxString(startup_params.m_strDefaultGCM.c_str(), *wxConvCurrent));
DVDRoot->SetPath(wxString(startup_params.m_strDVDRoot.c_str(), *wxConvCurrent));
ApploaderPath->SetPath(wxString(startup_params.m_strApploader.c_str(), *wxConvCurrent));
NANDRoot->SetPath(wxString(SConfig::GetInstance().m_NANDPath.c_str(), *wxConvCurrent));
DefaultISO->SetPath(StrToWxStr(startup_params.m_strDefaultGCM));
DVDRoot->SetPath(StrToWxStr(startup_params.m_strDVDRoot));
ApploaderPath->SetPath(StrToWxStr(startup_params.m_strApploader));
NANDRoot->SetPath(StrToWxStr(SConfig::GetInstance().m_NANDPath));
}
void CConfigMain::InitializeGUITooltips()
@@ -958,10 +958,10 @@ void CConfigMain::AudioSettingsChanged(wxCommandEvent& event)
break;
case ID_BACKEND:
VolumeSlider->Enable(SupportsVolumeChanges(std::string(BackendSelection->GetStringSelection().mb_str())));
Latency->Enable(std::string(BackendSelection->GetStringSelection().mb_str()) == BACKEND_OPENAL);
DPL2Decoder->Enable(std::string(BackendSelection->GetStringSelection().mb_str()) == BACKEND_OPENAL);
SConfig::GetInstance().sBackend = BackendSelection->GetStringSelection().mb_str();
VolumeSlider->Enable(SupportsVolumeChanges(WxStrToStr(BackendSelection->GetStringSelection())));
Latency->Enable(WxStrToStr(BackendSelection->GetStringSelection()) == BACKEND_OPENAL);
DPL2Decoder->Enable(WxStrToStr(BackendSelection->GetStringSelection()) == BACKEND_OPENAL);
SConfig::GetInstance().sBackend = WxStrToStr(BackendSelection->GetStringSelection());
AudioCommon::UpdateSoundStream();
break;
@@ -982,9 +982,9 @@ void CConfigMain::AddAudioBackends()
for (std::vector<std::string>::const_iterator iter = backends.begin();
iter != backends.end(); ++iter)
{
BackendSelection->Append(wxString::FromAscii((*iter).c_str()));
BackendSelection->Append(StrToWxStr((*iter).c_str()));
int num = BackendSelection->\
FindString(wxString::FromAscii(SConfig::GetInstance().sBackend.c_str()));
FindString(StrToWxStr(SConfig::GetInstance().sBackend.c_str()));
BackendSelection->SetSelection(num);
}
}
@@ -1046,12 +1046,12 @@ void CConfigMain::GCSettingsChanged(wxCommandEvent& event)
void CConfigMain::ChooseMemcardPath(std::string& strMemcard, bool isSlotA)
{
std::string filename = std::string(wxFileSelector(
std::string filename = WxStrToStr(wxFileSelector(
_("Choose a file to open"),
wxString::FromUTF8(File::GetUserPath(D_GCUSER_IDX).c_str()),
StrToWxStr(File::GetUserPath(D_GCUSER_IDX)),
isSlotA ? wxT(GC_MEMCARDA) : wxT(GC_MEMCARDB),
wxEmptyString,
_("Gamecube Memory Cards (*.raw,*.gcp)") + wxString(wxT("|*.raw;*.gcp"))).mb_str());
_("Gamecube Memory Cards (*.raw,*.gcp)") + wxString(wxT("|*.raw;*.gcp"))));
if (!filename.empty())
{
@@ -1242,7 +1242,7 @@ void CConfigMain::AddRemoveISOPaths(wxCommandEvent& event)
SConfig::GetInstance().m_ISOFolder.clear();
for (unsigned int i = 0; i < ISOPaths->GetCount(); i++)
SConfig::GetInstance().m_ISOFolder.push_back(std::string(ISOPaths->GetStrings()[i].mb_str()));
SConfig::GetInstance().m_ISOFolder.push_back(WxStrToStr(ISOPaths->GetStrings()[i]));
}
void CConfigMain::RecursiveDirectoryChanged(wxCommandEvent& WXUNUSED (event))
@@ -1253,24 +1253,24 @@ void CConfigMain::RecursiveDirectoryChanged(wxCommandEvent& WXUNUSED (event))
void CConfigMain::DefaultISOChanged(wxFileDirPickerEvent& WXUNUSED (event))
{
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM = DefaultISO->GetPath().mb_str();
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDefaultGCM = WxStrToStr(DefaultISO->GetPath());
}
void CConfigMain::DVDRootChanged(wxFileDirPickerEvent& WXUNUSED (event))
{
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDVDRoot = DVDRoot->GetPath().mb_str();
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strDVDRoot = WxStrToStr(DVDRoot->GetPath());
}
void CConfigMain::ApploaderPathChanged(wxFileDirPickerEvent& WXUNUSED (event))
{
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strApploader = ApploaderPath->GetPath().mb_str();
SConfig::GetInstance().m_LocalCoreStartupParameter.m_strApploader = WxStrToStr(ApploaderPath->GetPath());
}
void CConfigMain::NANDRootChanged(wxFileDirPickerEvent& WXUNUSED (event))
{
std::string NANDPath =
SConfig::GetInstance().m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, std::string(NANDRoot->GetPath().mb_str()));
NANDRoot->SetPath(wxString(NANDPath.c_str(), *wxConvCurrent));
SConfig::GetInstance().m_NANDPath = File::GetUserPath(D_WIIROOT_IDX, WxStrToStr(NANDRoot->GetPath()));
NANDRoot->SetPath(wxString(NANDPath));
SConfig::GetInstance().m_SYSCONF->UpdateLocation();
DiscIO::cUIDsys::AccessInstance().UpdateLocation();
DiscIO::CSharedContent::AccessInstance().UpdateLocation();
@@ -19,6 +19,7 @@
#include "StringUtil.h"
#include "PowerPC/PowerPC.h"
#include "BreakpointWindow.h"
#include "../WxUtils.h"
BEGIN_EVENT_TABLE(BreakPointDlg, wxDialog)
EVT_BUTTON(wxID_OK, BreakPointDlg::OnOK)
@@ -42,14 +43,14 @@ void BreakPointDlg::OnOK(wxCommandEvent& event)
{
wxString AddressString = m_pEditAddress->GetLineText(0);
u32 Address = 0;
if (AsciiToHex(AddressString.mb_str(), Address))
if (AsciiToHex(WxStrToStr(AddressString).c_str(), Address))
{
PowerPC::breakpoints.Add(Address);
Parent->NotifyUpdate();
Close();
}
else
PanicAlert("The address %s is invalid.", (const char *)AddressString.ToUTF8());
PanicAlert("The address %s is invalid.", WxStrToStr(AddressString).c_str());
event.Skip();
}
@@ -23,6 +23,7 @@
#include "PowerPC/PPCSymbolDB.h"
#include "PowerPC/PowerPC.h"
#include "HW/Memmap.h"
#include "../WxUtils.h"
CBreakPointView::CBreakPointView(wxWindow* parent, const wxWindowID id)
: wxListCtrl(parent, id, wxDefaultPosition, wxDefaultSize,
@@ -50,20 +51,20 @@ void CBreakPointView::Update()
if (!rBP.bTemporary)
{
wxString temp;
temp = wxString::FromAscii(rBP.bOn ? "on" : " ");
temp = StrToWxStr(rBP.bOn ? "on" : " ");
int Item = InsertItem(0, temp);
temp = wxString::FromAscii("BP");
temp = StrToWxStr("BP");
SetItem(Item, 1, temp);
Symbol *symbol = g_symbolDB.GetSymbolFromAddr(rBP.iAddress);
if (symbol)
{
temp = wxString::FromAscii(g_symbolDB.GetDescription(rBP.iAddress));
temp = StrToWxStr(g_symbolDB.GetDescription(rBP.iAddress));
SetItem(Item, 2, temp);
}
sprintf(szBuffer, "%08x", rBP.iAddress);
temp = wxString::FromAscii(szBuffer);
temp = StrToWxStr(szBuffer);
SetItem(Item, 3, temp);
SetItemData(Item, rBP.iAddress);
@@ -76,27 +77,27 @@ void CBreakPointView::Update()
const TMemCheck& rMemCheck = rMemChecks[i];
wxString temp;
temp = wxString::FromAscii((rMemCheck.Break || rMemCheck.Log) ? "on" : " ");
temp = StrToWxStr((rMemCheck.Break || rMemCheck.Log) ? "on" : " ");
int Item = InsertItem(0, temp);
temp = wxString::FromAscii("MC");
temp = StrToWxStr("MC");
SetItem(Item, 1, temp);
Symbol *symbol = g_symbolDB.GetSymbolFromAddr(rMemCheck.StartAddress);
if (symbol)
{
temp = wxString::FromAscii(g_symbolDB.GetDescription(rMemCheck.StartAddress));
temp = StrToWxStr(g_symbolDB.GetDescription(rMemCheck.StartAddress));
SetItem(Item, 2, temp);
}
sprintf(szBuffer, "%08x to %08x", rMemCheck.StartAddress, rMemCheck.EndAddress);
temp = wxString::FromAscii(szBuffer);
temp = StrToWxStr(szBuffer);
SetItem(Item, 3, temp);
size_t c = 0;
if (rMemCheck.OnRead) szBuffer[c++] = 'r';
if (rMemCheck.OnWrite) szBuffer[c++] = 'w';
szBuffer[c] = 0x00;
temp = wxString::FromAscii(szBuffer);
temp = StrToWxStr(szBuffer);
SetItem(Item, 4, temp);
SetItemData(Item, rMemCheck.StartAddress);
+20 -19
View File
@@ -23,6 +23,7 @@
#include "Host.h"
#include "CodeView.h"
#include "SymbolDB.h"
#include "../WxUtils.h"
#include <wx/event.h>
#include <wx/clipbrd.h>
@@ -223,7 +224,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
{
char disasm[256];
debugger->disasm(selection, disasm, 256);
wxTheClipboard->SetData(new wxTextDataObject(wxString::FromAscii(disasm)));
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(disasm)));
}
break;
@@ -231,7 +232,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
{
char temp[24];
sprintf(temp, "%08x", debugger->readInstruction(selection));
wxTheClipboard->SetData(new wxTextDataObject(wxString::FromAscii(temp)));
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
}
break;
@@ -252,7 +253,7 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
debugger->disasm(addr, disasm, 256);
text = text + StringFromFormat("%08x: ", addr) + disasm + "\r\n";
}
wxTheClipboard->SetData(new wxTextDataObject(wxString::FromAscii(text.c_str())));
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(text.c_str())));
}
}
break;
@@ -297,12 +298,12 @@ void CCodeView::OnPopupMenu(wxCommandEvent& event)
Symbol *symbol = symbol_db->GetSymbolFromAddr(selection);
if (symbol)
{
wxTextEntryDialog input_symbol(this, wxString::FromAscii("Rename symbol:"),
wxTextEntryDialog input_symbol(this, StrToWxStr("Rename symbol:"),
wxGetTextFromUserPromptStr,
wxString::FromAscii(symbol->name.c_str()));
StrToWxStr(symbol->name.c_str()));
if (input_symbol.ShowModal() == wxID_OK)
{
symbol->name = input_symbol.GetValue().mb_str();
symbol->name = WxStrToStr(input_symbol.GetValue());
Refresh(); // Redraw to show the renamed symbol
}
Host_NotifyMapLoaded();
@@ -327,23 +328,23 @@ void CCodeView::OnMouseUpR(wxMouseEvent& event)
wxMenu* menu = new wxMenu;
//menu->Append(IDM_GOTOINMEMVIEW, "&Goto in mem view");
menu->Append(IDM_FOLLOWBRANCH,
wxString::FromAscii("&Follow branch"))->Enable(AddrToBranch(selection) ? true : false);
StrToWxStr("&Follow branch"))->Enable(AddrToBranch(selection) ? true : false);
menu->AppendSeparator();
#if wxUSE_CLIPBOARD
menu->Append(IDM_COPYADDRESS, wxString::FromAscii("Copy &address"));
menu->Append(IDM_COPYFUNCTION, wxString::FromAscii("Copy &function"))->Enable(isSymbol);
menu->Append(IDM_COPYCODE, wxString::FromAscii("Copy &code line"));
menu->Append(IDM_COPYHEX, wxString::FromAscii("Copy &hex"));
menu->Append(IDM_COPYADDRESS, StrToWxStr("Copy &address"));
menu->Append(IDM_COPYFUNCTION, StrToWxStr("Copy &function"))->Enable(isSymbol);
menu->Append(IDM_COPYCODE, StrToWxStr("Copy &code line"));
menu->Append(IDM_COPYHEX, StrToWxStr("Copy &hex"));
menu->AppendSeparator();
#endif
menu->Append(IDM_RENAMESYMBOL, wxString::FromAscii("Rename &symbol"))->Enable(isSymbol);
menu->Append(IDM_RENAMESYMBOL, StrToWxStr("Rename &symbol"))->Enable(isSymbol);
menu->AppendSeparator();
menu->Append(IDM_RUNTOHERE, _("&Run To Here"));
menu->Append(IDM_ADDFUNCTION, _("&Add function"));
menu->Append(IDM_JITRESULTS, wxString::FromAscii("PPC vs X86"));
menu->Append(IDM_INSERTBLR, wxString::FromAscii("Insert &blr"));
menu->Append(IDM_INSERTNOP, wxString::FromAscii("Insert &nop"));
menu->Append(IDM_PATCHALERT, wxString::FromAscii("Patch alert"));
menu->Append(IDM_JITRESULTS, StrToWxStr("PPC vs X86"));
menu->Append(IDM_INSERTBLR, StrToWxStr("Insert &blr"));
menu->Append(IDM_INSERTNOP, StrToWxStr("Insert &nop"));
menu->Append(IDM_PATCHALERT, StrToWxStr("Patch alert"));
PopupMenu(menu);
event.Skip(true);
}
@@ -489,7 +490,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
dc.SetTextForeground(_T("#000000"));
}
dc.DrawText(wxString::FromAscii(dis2), 17 + 17*charWidth, rowY1);
dc.DrawText(StrToWxStr(dis2), 17 + 17*charWidth, rowY1);
// ------------
}
@@ -499,7 +500,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
else
dc.SetTextForeground(_T("#8000FF")); // purple
dc.DrawText(wxString::FromAscii(dis), 17 + (plain ? 1*charWidth : 9*charWidth), rowY1);
dc.DrawText(StrToWxStr(dis), 17 + (plain ? 1*charWidth : 9*charWidth), rowY1);
if (desc[0] == 0)
{
@@ -513,7 +514,7 @@ void CCodeView::OnPaint(wxPaintEvent& event)
//UnDecorateSymbolName(desc,temp,255,UNDNAME_COMPLETE);
if (strlen(desc))
{
dc.DrawText(wxString::FromAscii(desc), 17 + 35 * charWidth, rowY1);
dc.DrawText(StrToWxStr(desc), 17 + 35 * charWidth, rowY1);
}
}
@@ -30,6 +30,7 @@
#include "CodeWindow.h"
#include "CodeView.h"
#include "../WxUtils.h"
#include "FileUtil.h"
#include "Core.h"
#include "HW/Memmap.h"
@@ -210,7 +211,7 @@ void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event)
wxTextCtrl* pAddrCtrl = (wxTextCtrl*)GetToolBar()->FindControl(IDM_ADDRBOX);
wxString txt = pAddrCtrl->GetValue();
std::string text(txt.mb_str());
std::string text(WxStrToStr(txt));
text = StripSpaces(text);
if (text.size() == 8)
{
@@ -312,7 +313,7 @@ void CCodeWindow::UpdateLists()
Symbol *caller_symbol = g_symbolDB.GetSymbolFromAddr(caller_addr);
if (caller_symbol)
{
int idx = callers->Append(wxString::FromAscii(StringFromFormat
int idx = callers->Append(StrToWxStr(StringFromFormat
("< %s (%08x)", caller_symbol->name.c_str(), caller_addr).c_str()));
callers->SetClientData(idx, (void*)(u64)caller_addr);
}
@@ -325,7 +326,7 @@ void CCodeWindow::UpdateLists()
Symbol *call_symbol = g_symbolDB.GetSymbolFromAddr(call_addr);
if (call_symbol)
{
int idx = calls->Append(wxString::FromAscii(StringFromFormat
int idx = calls->Append(StrToWxStr(StringFromFormat
("> %s (%08x)", call_symbol->name.c_str(), call_addr).c_str()));
calls->SetClientData(idx, (void*)(u64)call_addr);
}
@@ -344,12 +345,12 @@ void CCodeWindow::UpdateCallstack()
for (size_t i = 0; i < stack.size(); i++)
{
int idx = callstack->Append(wxString::FromAscii(stack[i].Name.c_str()));
int idx = callstack->Append(StrToWxStr(stack[i].Name.c_str()));
callstack->SetClientData(idx, (void*)(u64)stack[i].vAddress);
}
if (!ret)
callstack->Append(wxString::FromAscii("invalid callstack"));
callstack->Append(StrToWxStr("invalid callstack"));
}
// Create CPU Mode menus
@@ -360,7 +361,7 @@ void CCodeWindow::CreateMenu(const SCoreStartupParameter& _LocalCoreStartupParam
wxMenu* pCoreMenu = new wxMenu;
wxMenuItem* interpreter = pCoreMenu->Append(IDM_INTERPRETER, _("&Interpreter core"),
wxString::FromAscii("This is necessary to get break points"
StrToWxStr("This is necessary to get break points"
" and stepping to work as explained in the Developer Documentation. But it can be very"
" slow, perhaps slower than 1 fps."),
wxITEM_CHECK);
@@ -428,7 +429,7 @@ void CCodeWindow::CreateMenuOptions(wxMenu* pMenu)
boottopause->Check(bBootToPause);
wxMenuItem* automaticstart = pMenu->Append(IDM_AUTOMATICSTART, _("&Automatic start"),
wxString::FromAscii(
StrToWxStr(
"Automatically load the Default ISO when Dolphin starts, or the last game you loaded,"
" if you have not given it an elf file with the --elf command line. [This can be"
" convenient if you are bug-testing with a certain game and want to rebuild"
@@ -515,10 +516,10 @@ void CCodeWindow::OnJitMenu(wxCommandEvent& event)
for (u32 addr = 0x80000000; addr < 0x80100000; addr += 4)
{
const char *name = PPCTables::GetInstructionName(Memory::ReadUnchecked_U32(addr));
if (name && !strcmp((const char *)str.mb_str(), name))
auto const wx_name = WxStrToStr(str);
if (name && (wx_name == name))
{
std::string mb_str(str.mb_str());
NOTICE_LOG(POWERPC, "Found %s at %08x", mb_str.c_str(), addr);
NOTICE_LOG(POWERPC, "Found %s at %08x", wx_name.c_str(), addr);
}
}
break;
@@ -25,6 +25,7 @@
#include "DebuggerUIUtil.h"
#include "../WxUtils.h"
#include "RegisterWindow.h"
#include "BreakpointWindow.h"
#include "MemoryWindow.h"
@@ -65,7 +66,7 @@ void CCodeWindow::Load()
std::string fontDesc;
ini.Get("General", "DebuggerFont", &fontDesc);
if (!fontDesc.empty())
DebuggerFont.SetNativeFontInfoUserDesc(wxString::FromAscii(fontDesc.c_str()));
DebuggerFont.SetNativeFontInfoUserDesc(StrToWxStr(fontDesc.c_str()));
// Boot to pause or not
ini.Get("General", "AutomaticStart", &bAutomaticStart, false);
@@ -107,7 +108,7 @@ void CCodeWindow::Save()
ini.Load(File::GetUserPath(F_DEBUGGERCONFIG_IDX));
ini.Set("General", "DebuggerFont",
std::string(DebuggerFont.GetNativeFontInfoUserDesc().mb_str()));
WxStrToStr(DebuggerFont.GetNativeFontInfoUserDesc()));
// Boot to pause or not
ini.Set("General", "AutomaticStart", GetMenuBar()->IsChecked(IDM_AUTOMATICSTART));
@@ -154,7 +155,7 @@ void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar)
pSymbolsMenu->Append(IDM_SAVEMAPFILE, _("&Save symbol map"));
pSymbolsMenu->AppendSeparator();
pSymbolsMenu->Append(IDM_SAVEMAPFILEWITHCODES, _("Save code"),
wxString::FromAscii("Save the entire disassembled code. This may take a several seconds"
StrToWxStr("Save the entire disassembled code. This may take a several seconds"
" and may require between 50 and 100 MB of hard drive space. It will only save code"
" that are in the first 4 MB of memory, if you are debugging a game that load .rel"
" files with code to memory you may want to increase that to perhaps 8 MB, you can do"
@@ -284,7 +285,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
if (!path.IsEmpty())
{
std::ifstream f(path.mb_str());
std::ifstream f(WxStrToStr(path));
std::string line;
while (std::getline(f, line))
@@ -312,13 +313,13 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
{
wxTextEntryDialog input_prefix(
this,
wxString::FromAscii("Only export symbols with prefix:\n(Blank for all symbols)"),
StrToWxStr("Only export symbols with prefix:\n(Blank for all symbols)"),
wxGetTextFromUserPromptStr,
wxEmptyString);
if (input_prefix.ShowModal() == wxID_OK)
{
std::string prefix(input_prefix.GetValue().mb_str());
std::string prefix(WxStrToStr(input_prefix.GetValue()));
wxString path = wxFileSelector(
_T("Save signature as"), wxEmptyString, wxEmptyString, wxEmptyString,
@@ -328,8 +329,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
{
SignatureDB db;
db.Initialize(&g_symbolDB, prefix.c_str());
std::string filename(path.mb_str());
db.Save(path.mb_str());
db.Save(WxStrToStr(path).c_str());
}
}
}
@@ -343,7 +343,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
if (!path.IsEmpty())
{
SignatureDB db;
db.Load(path.mb_str());
db.Load(WxStrToStr(path).c_str());
db.Apply(&g_symbolDB);
}
}
@@ -366,7 +366,7 @@ void CCodeWindow::NotifyMapLoaded()
symbols->Clear();
for (PPCSymbolDB::XFuncMap::iterator iter = g_symbolDB.GetIterator(); iter != g_symbolDB.End(); ++iter)
{
int idx = symbols->Append(wxString::FromAscii(iter->second.name.c_str()));
int idx = symbols->Append(StrToWxStr(iter->second.name.c_str()));
symbols->SetClientData(idx, (void*)&iter->second);
}
symbols->Thaw();
@@ -22,6 +22,7 @@
#include <wx/artprov.h>
#include "../WxUtils.h"
#include "StringUtil.h"
#include "DSPDebugWindow.h"
#include "DSPRegisterView.h"
@@ -220,7 +221,7 @@ void DSPDebuggerLLE::UpdateSymbolMap()
for (SymbolDB::XFuncMap::iterator iter = DSPSymbols::g_dsp_symbol_db.GetIterator();
iter != DSPSymbols::g_dsp_symbol_db.End(); ++iter)
{
int idx = m_SymbolList->Append(wxString::FromAscii(iter->second.name.c_str()));
int idx = m_SymbolList->Append(StrToWxStr(iter->second.name.c_str()));
m_SymbolList->SetClientData(idx, (void*)&iter->second);
}
m_SymbolList->Thaw();
@@ -250,8 +251,7 @@ void DSPDebuggerLLE::OnAddrBoxChange(wxCommandEvent& event)
wxTextCtrl* pAddrCtrl = (wxTextCtrl*)m_Toolbar->FindControl(ID_ADDRBOX);
wxString txt = pAddrCtrl->GetValue();
std::string text(txt.mb_str());
text = StripSpaces(text);
auto text = StripSpaces(WxStrToStr(txt));
if (text.size())
{
u32 addr;
@@ -17,7 +17,7 @@
#include "DSPDebugWindow.h"
#include "DSPRegisterView.h"
#include "../WxUtils.h"
wxString CDSPRegTable::GetValue(int row, int col)
{
@@ -25,7 +25,7 @@ wxString CDSPRegTable::GetValue(int row, int col)
{
switch (col)
{
case 0: return wxString::FromAscii(pdregname(row));
case 0: return StrToWxStr(pdregname(row));
case 1: return wxString::Format(wxT("0x%04x"), DSPCore_ReadRegister(row));
default: return wxEmptyString;
}
@@ -37,6 +37,7 @@
#include "Core.h"
#include "StringUtil.h"
#include "LogManager.h"
#include "../WxUtils.h"
#include "../Globals.h"
@@ -15,6 +15,7 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "../WxUtils.h"
#include "MemoryCheckDlg.h"
#include "Common.h"
#include "StringUtil.h"
@@ -79,9 +80,9 @@ void MemoryCheckDlg::OnOK(wxCommandEvent& event)
u32 StartAddress, EndAddress;
bool EndAddressOK = EndAddressString.Len() &&
AsciiToHex(EndAddressString.mb_str(), EndAddress);
AsciiToHex(WxStrToStr(EndAddressString).c_str(), EndAddress);
if (AsciiToHex(StartAddressString.mb_str(), StartAddress) &&
if (AsciiToHex(WxStrToStr(StartAddressString).c_str(), StartAddress) &&
(OnRead || OnWrite) && (Log || Break))
{
TMemCheck MemCheck;
@@ -22,6 +22,8 @@
#include "HW/Memmap.h"
#include "MemoryView.h"
#include "../WxUtils.h"
#include <wx/event.h>
#include <wx/clipbrd.h>
@@ -149,7 +151,7 @@ void CMemoryView::OnPopupMenu(wxCommandEvent& event)
{
char temp[24];
sprintf(temp, "%08x", debugger->readExtraMemory(memory, selection));
wxTheClipboard->SetData(new wxTextDataObject(wxString::FromAscii(temp)));
wxTheClipboard->SetData(new wxTextDataObject(StrToWxStr(temp)));
}
break;
#endif
@@ -186,16 +188,16 @@ void CMemoryView::OnMouseDownR(wxMouseEvent& event)
wxMenu* menu = new wxMenu;
//menu.Append(IDM_GOTOINMEMVIEW, "&Goto in mem view");
#if wxUSE_CLIPBOARD
menu->Append(IDM_COPYADDRESS, wxString::FromAscii("Copy &address"));
menu->Append(IDM_COPYHEX, wxString::FromAscii("Copy &hex"));
menu->Append(IDM_COPYADDRESS, StrToWxStr("Copy &address"));
menu->Append(IDM_COPYHEX, StrToWxStr("Copy &hex"));
#endif
menu->Append(IDM_TOGGLEMEMORY, wxString::FromAscii("Toggle &memory"));
menu->Append(IDM_TOGGLEMEMORY, StrToWxStr("Toggle &memory"));
wxMenu* viewAsSubMenu = new wxMenu;
viewAsSubMenu->Append(IDM_VIEWASFP, wxString::FromAscii("FP value"));
viewAsSubMenu->Append(IDM_VIEWASASCII, wxString::FromAscii("ASCII"));
viewAsSubMenu->Append(IDM_VIEWASHEX, wxString::FromAscii("Hex"));
menu->AppendSubMenu(viewAsSubMenu, wxString::FromAscii("View As:"));
viewAsSubMenu->Append(IDM_VIEWASFP, StrToWxStr("FP value"));
viewAsSubMenu->Append(IDM_VIEWASASCII, StrToWxStr("ASCII"));
viewAsSubMenu->Append(IDM_VIEWASHEX, StrToWxStr("Hex"));
menu->AppendSubMenu(viewAsSubMenu, StrToWxStr("View As:"));
PopupMenu(menu);
}
@@ -285,7 +287,7 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
char mem[256];
debugger->getRawMemoryString(memory, address, mem, 256);
dc.SetTextForeground(_T("#000080"));
dc.DrawText(wxString::FromAscii(mem), 17+fontSize*(8), rowY1);
dc.DrawText(StrToWxStr(mem), 17+fontSize*(8), rowY1);
dc.SetTextForeground(_T("#000000"));
}
@@ -361,9 +363,9 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
char desc[256] = "";
if (viewAsType != VIEWAS_HEX)
dc.DrawText(wxString::FromAscii(dis), textPlacement + fontSize*(8 + 8), rowY1);
dc.DrawText(StrToWxStr(dis), textPlacement + fontSize*(8 + 8), rowY1);
else
dc.DrawText(wxString::FromAscii(dis), textPlacement, rowY1);
dc.DrawText(StrToWxStr(dis), textPlacement, rowY1);
if (desc[0] == 0)
strcpy(desc, debugger->getDescription(address).c_str());
@@ -371,7 +373,7 @@ void CMemoryView::OnPaint(wxPaintEvent& event)
dc.SetTextForeground(_T("#0000FF"));
if (strlen(desc))
dc.DrawText(wxString::FromAscii(desc), 17+fontSize*((8+8+8+30)*2), rowY1);
dc.DrawText(StrToWxStr(desc), 17+fontSize*((8+8+8+30)*2), rowY1);
// Show blue memory check dot
if (debugger->isMemCheck(address))
@@ -20,6 +20,8 @@
#include <wx/listctrl.h>
#include <wx/thread.h>
#include <wx/listctrl.h>
#include "../WxUtils.h"
#include "MemoryWindow.h"
#include "HW/CPU.h"
#include "PowerPC/PowerPC.h"
@@ -152,8 +154,8 @@ void CMemoryWindow::JumpToAddress(u32 _Address)
void CMemoryWindow::SetMemoryValue(wxCommandEvent& event)
{
std::string str_addr = std::string(addrbox->GetValue().mb_str());
std::string str_val = std::string(valbox->GetValue().mb_str());
std::string str_addr = WxStrToStr(addrbox->GetValue());
std::string str_val = WxStrToStr(valbox->GetValue());
u32 addr;
u32 val;
@@ -179,7 +181,7 @@ void CMemoryWindow::OnAddrBoxChange(wxCommandEvent& event)
if (txt.size())
{
u32 addr;
sscanf(txt.mb_str(), "%08x", &addr);
sscanf(WxStrToStr(txt).c_str(), "%08x", &addr);
memview->Center(addr & ~3);
}
@@ -349,10 +351,7 @@ void CMemoryWindow::onSearch(wxCommandEvent& event)
tmpstr = new char[newsize + 1];
memset(tmpstr, 0, newsize + 1);
}
//sprintf(tmpstr, "%s%s", tmpstr, rawData.c_str());
//strcpy(&tmpstr[1], rawData.ToAscii());
//memcpy(&tmpstr[1], &rawData.c_str()[0], rawData.size());
sprintf(tmpstr, "%s%s", tmpstr, (const char *)rawData.mb_str());
sprintf(tmpstr, "%s%s", tmpstr, WxStrToStr(rawData).c_str());
tmp2 = &Dest.front();
count = 0;
for(i = 0; i < strlen(tmpstr); i++)
@@ -376,7 +375,7 @@ void CMemoryWindow::onSearch(wxCommandEvent& event)
tmpstr = new char[size+1];
tmp2 = &Dest.front();
sprintf(tmpstr, "%s", (const char *)rawData.mb_str());
sprintf(tmpstr, "%s", WxStrToStr(rawData).c_str());
for(i = 0; i < size; i++)
tmp2[i] = tmpstr[i];
@@ -393,7 +392,7 @@ void CMemoryWindow::onSearch(wxCommandEvent& event)
u32 addr = 0;
if (txt.size())
{
sscanf(txt.mb_str(), "%08x", &addr);
sscanf(WxStrToStr(txt).c_str(), "%08x", &addr);
}
i = addr+4;
for( ; i < szRAM; i++)
@@ -20,6 +20,7 @@
#include "PowerPC/PowerPC.h"
#include "HW/ProcessorInterface.h"
#include "IniFile.h"
#include "../WxUtils.h"
// F-zero 80005e60 wtf??
@@ -51,9 +52,9 @@ wxString CRegTable::GetValue(int row, int col)
{
if (row < 32) {
switch (col) {
case 0: return wxString::FromAscii(GetGPRName(row));
case 0: return StrToWxStr(GetGPRName(row));
case 1: return wxString::Format(wxT("%08x"), GPR(row));
case 2: return wxString::FromAscii(GetFPRName(row));
case 2: return StrToWxStr(GetFPRName(row));
case 3: return wxString::Format(wxT("%016llx"), riPS0(row));
case 4: return wxString::Format(wxT("%016llx"), riPS1(row));
default: return wxEmptyString;
@@ -61,7 +62,7 @@ wxString CRegTable::GetValue(int row, int col)
} else {
if (row - 32 < NUM_SPECIALS) {
switch (col) {
case 0: return wxString::FromAscii(special_reg_names[row - 32]);
case 0: return StrToWxStr(special_reg_names[row - 32]);
case 1: return wxString::Format(wxT("%08x"), GetSpecialRegValue(row - 32));
default: return wxEmptyString;
}
@@ -91,7 +92,7 @@ static void SetSpecialRegValue(int reg, u32 value) {
void CRegTable::SetValue(int row, int col, const wxString& strNewVal)
{
u32 newVal = 0;
if (TryParse(std::string(strNewVal.mb_str()), &newVal))
if (TryParse(WxStrToStr(strNewVal), &newVal))
{
if (row < 32) {
if (col == 1)
+4 -3
View File
@@ -22,6 +22,7 @@
#include "FifoPlayer/FifoPlayer.h"
#include "FifoPlayer/FifoRecorder.h"
#include "OpcodeDecoding.h"
#include "WxUtils.h"
#include <wx/spinctrl.h>
#include <wx/clipbrd.h>
@@ -395,7 +396,7 @@ void FifoPlayerDlg::OnSaveFile(wxCommandEvent& WXUNUSED(event))
if (!path.empty())
{
wxBeginBusyCursor();
bool result = file->Save(path.mb_str());
bool result = file->Save(WxStrToStr(path).c_str());
wxEndBusyCursor();
if (!result)
@@ -752,10 +753,10 @@ void FifoPlayerDlg::OnObjectCmdListSelectionChanged(wxCommandEvent& event)
char name[64]="\0", desc[512]="\0";
GetBPRegInfo(cmddata+1, name, sizeof(name), desc, sizeof(desc));
newLabel = _("BP register ");
newLabel += (name[0] != '\0') ? wxString(name, *wxConvCurrent) : wxString::Format(_("UNKNOWN_%02X"), *(cmddata+1));
newLabel += (name[0] != '\0') ? StrToWxStr(name) : wxString::Format(_("UNKNOWN_%02X"), *(cmddata+1));
newLabel += wxT(":\n");
if (desc[0] != '\0')
newLabel += wxString(desc, *wxConvCurrent);
newLabel += StrToWxStr(desc);
else
newLabel += _("No description available");
}
+6 -5
View File
@@ -21,6 +21,7 @@
#include "Globals.h" // Local
#include "Frame.h"
#include "LogWindow.h"
#include "WxUtils.h"
#include "ConfigManager.h" // Core
@@ -548,7 +549,7 @@ void CFrame::OnDropDownToolbarItem(wxAuiToolBarEvent& event)
for (u32 i = 0; i < Perspectives.size(); i++)
{
wxMenuItem* mItem = new wxMenuItem(menuPopup, IDM_PERSPECTIVES_0 + i,
wxString::FromAscii(Perspectives[i].Name.c_str()),
StrToWxStr(Perspectives[i].Name.c_str()),
wxT(""), wxITEM_CHECK);
menuPopup->Append(mItem);
if (i == ActivePerspective) mItem->Check(true);
@@ -580,7 +581,7 @@ void CFrame::OnToolBar(wxCommandEvent& event)
return;
}
SaveIniPerspectives();
GetStatusBar()->SetStatusText(wxString::FromAscii(std::string
GetStatusBar()->SetStatusText(StrToWxStr(std::string
("Saved " + Perspectives[ActivePerspective].Name).c_str()), 0);
break;
case IDM_PERSPECTIVES_ADD_PANE:
@@ -633,7 +634,7 @@ void CFrame::OnDropDownToolbarSelect(wxCommandEvent& event)
}
SPerspectives Tmp;
Tmp.Name = dlg.GetValue().mb_str();
Tmp.Name = WxStrToStr(dlg.GetValue());
Tmp.Perspective = m_Mgr->SavePerspective();
ActivePerspective = (u32)Perspectives.size();
@@ -870,7 +871,7 @@ void CFrame::LoadIniPerspectives()
ini.Get(_Section.c_str(), "Width", &_Width, "70,25");
ini.Get(_Section.c_str(), "Height", &_Height, "80,80");
Tmp.Perspective = wxString::FromAscii(_Perspective.c_str());
Tmp.Perspective = StrToWxStr(_Perspective.c_str());
SplitString(_Width, ',', _SWidth);
SplitString(_Height, ',', _SHeight);
@@ -940,7 +941,7 @@ void CFrame::SaveIniPerspectives()
for (u32 i = 0; i < Perspectives.size(); i++)
{
std::string _Section = "P - " + Perspectives[i].Name;
ini.Set(_Section.c_str(), "Perspective", Perspectives[i].Perspective.mb_str());
ini.Set(_Section.c_str(), "Perspective", WxStrToStr(Perspectives[i].Perspective));
std::string SWidth = "", SHeight = "";
for (u32 j = 0; j < Perspectives[i].Width.size(); j++)
+13 -14
View File
@@ -101,7 +101,7 @@ void CFrame::CreateMenu()
drives = cdio_get_devices();
// Windows Limitation of 24 character drives
for (unsigned int i = 0; i < drives.size() && i < 24; i++) {
externalDrive->Append(IDM_DRIVE1 + i, wxString::FromAscii(drives[i].c_str()));
externalDrive->Append(IDM_DRIVE1 + i, StrToWxStr(drives[i].c_str()));
}
fileMenu->AppendSeparator();
@@ -601,12 +601,10 @@ void CFrame::DoOpen(bool Boot)
// Should we boot a new game or just change the disc?
if (Boot && !path.IsEmpty())
BootGame(std::string(path.mb_str()));
BootGame(WxStrToStr(path));
else
{
char newDiscpath[2048];
strncpy(newDiscpath, path.mb_str(), strlen(path.mb_str())+1);
DVDInterface::ChangeDisc(newDiscpath);
DVDInterface::ChangeDisc(WxStrToStr(path).c_str());
}
}
@@ -693,7 +691,7 @@ void CFrame::OnPlayRecording(wxCommandEvent& WXUNUSED (event))
GetMenuBar()->FindItem(IDM_RECORDREADONLY)->Check(true);
}
if(Movie::PlayInput(path.mb_str()))
if (Movie::PlayInput(WxStrToStr(path).c_str()))
BootGame(std::string(""));
}
@@ -1015,7 +1013,7 @@ void CFrame::DoStop()
X11Utils::InhibitScreensaver(X11Utils::XDisplayFromHandle(GetHandle()),
X11Utils::XWindowFromHandle(GetHandle()), false);
#endif
m_RenderFrame->SetTitle(wxString::FromAscii(scm_rev_str));
m_RenderFrame->SetTitle(StrToWxStr(scm_rev_str));
// Destroy the renderer frame when not rendering to main
m_RenderParent->Unbind(wxEVT_SIZE, &CFrame::OnRenderParentResize, this);
@@ -1081,7 +1079,7 @@ void CFrame::DoRecordingSave()
if(path.IsEmpty())
return;
Movie::SaveRecording(path.mb_str());
Movie::SaveRecording(WxStrToStr(path).c_str());
if (!paused)
DoPause();
@@ -1212,7 +1210,7 @@ void CFrame::StatusBarMessage(const char * Text, ...)
vsnprintf(Str, MAX_BYTES, Text, ArgPtr);
va_end(ArgPtr);
if (this->GetStatusBar()->IsEnabled()) this->GetStatusBar()->SetStatusText(wxString::FromAscii(Str),0);
if (this->GetStatusBar()->IsEnabled()) this->GetStatusBar()->SetStatusText(StrToWxStr(Str),0);
}
@@ -1248,7 +1246,8 @@ void CFrame::OnImportSave(wxCommandEvent& WXUNUSED (event))
if (!path.IsEmpty())
{
CWiiSaveCrypted* saveFile = new CWiiSaveCrypted(path.mb_str());
// TODO: Does this actually need to be dynamically allocated for some reason?
CWiiSaveCrypted* saveFile = new CWiiSaveCrypted(WxStrToStr(path).c_str());
delete saveFile;
}
}
@@ -1288,7 +1287,7 @@ void CFrame::OnInstallWAD(wxCommandEvent& event)
_T("Wii WAD file (*.wad)|*.wad"),
wxFD_OPEN | wxFD_PREVIEW | wxFD_FILE_MUST_EXIST,
this);
fileName = path.mb_str();
fileName = WxStrToStr(path);
break;
}
default:
@@ -1354,7 +1353,7 @@ void CFrame::ConnectWiimote(int wm_idx, bool connect)
GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->Activate(connect);
wxString msg(wxString::Format(wxT("Wiimote %i %s"), wm_idx + 1,
connect ? wxT("Connected") : wxT("Disconnected")));
Core::DisplayMessage(msg.ToAscii(), 3000);
Core::DisplayMessage(WxStrToStr(msg), 3000);
Host_UpdateMainFrame();
}
}
@@ -1394,7 +1393,7 @@ void CFrame::OnLoadStateFromFile(wxCommandEvent& WXUNUSED (event))
this);
if (!path.IsEmpty())
State::LoadAs((const char*)path.mb_str());
State::LoadAs(WxStrToStr(path));
}
void CFrame::OnSaveStateToFile(wxCommandEvent& WXUNUSED (event))
@@ -1408,7 +1407,7 @@ void CFrame::OnSaveStateToFile(wxCommandEvent& WXUNUSED (event))
this);
if (!path.IsEmpty())
State::SaveAs((const char*)path.mb_str());
State::SaveAs(WxStrToStr(path));
}
void CFrame::OnLoadLastState(wxCommandEvent& WXUNUSED (event))
+17 -17
View File
@@ -257,7 +257,7 @@ void CGameListCtrl::BrowseForDirectory()
if (dialog.ShowModal() == wxID_OK)
{
std::string sPath(dialog.GetPath().mb_str());
std::string sPath(WxStrToStr(dialog.GetPath()));
std::vector<std::string>::iterator itResult = std::find(
SConfig::GetInstance().m_ISOFolder.begin(),
SConfig::GetInstance().m_ISOFolder.end(), sPath);
@@ -402,7 +402,7 @@ wxString NiceSizeFormat(s64 _size)
wxString NiceString;
char tempstr[32];
sprintf(tempstr,"%3.1f %s", f, sizes[s]);
NiceString = wxString::FromAscii(tempstr);
NiceString = StrToWxStr(tempstr);
return(NiceString);
}
@@ -614,7 +614,7 @@ void CGameListCtrl::ScanForISOs()
// Update with the progress (i) and the message
dialog.Update(i, wxString::Format(_("Scanning %s"),
wxString(FileName.c_str(), *wxConvCurrent).c_str()));
StrToWxStr(FileName).c_str()));
if (dialog.WasCancelled())
break;
@@ -858,7 +858,7 @@ void CGameListCtrl::OnMouseMotion(wxMouseEvent& event)
char temp[2048];
sprintf(temp, "^ %s%s%s", emuState[emu_state - 1],
issues.size() > 0 ? " :\n" : "", issues.c_str());
toolTip = new wxEmuStateTip(this, wxString(temp, *wxConvCurrent), &toolTip);
toolTip = new wxEmuStateTip(this, StrToWxStr(temp), &toolTip);
}
else
toolTip = new wxEmuStateTip(this, _("Not Set"), &toolTip);
@@ -1115,9 +1115,9 @@ void CGameListCtrl::OnWiki(wxCommandEvent& WXUNUSED (event))
void CGameListCtrl::MultiCompressCB(const char* text, float percent, void* arg)
{
percent = (((float)m_currentItem) + percent) / (float)m_numberItem;
wxString textString(StringFromFormat("%s (%i/%i) - %s",
wxString textString(StrToWxStr(StringFromFormat("%s (%i/%i) - %s",
m_currentFilename.c_str(), (int)m_currentItem+1,
(int)m_numberItem, text).c_str(), *wxConvCurrent);
(int)m_numberItem, text)));
((wxProgressDialog*)arg)->Update((int)(percent*1000), textString);
}
@@ -1170,13 +1170,13 @@ void CGameListCtrl::CompressSelection(bool _compress)
std::string OutputFileName;
BuildCompleteFilename(OutputFileName,
(const char *)browseDialog.GetPath().mb_str(wxConvUTF8),
WxStrToStr(browseDialog.GetPath()),
FileName);
if (wxFileExists(wxString::FromAscii(OutputFileName.c_str())) &&
if (wxFileExists(StrToWxStr(OutputFileName.c_str())) &&
wxMessageBox(
wxString::Format(_("The file %s already exists.\nDo you wish to replace it?"),
wxString(OutputFileName.c_str(), *wxConvCurrent).c_str()),
StrToWxStr(OutputFileName).c_str()),
_("Confirm File Overwrite"),
wxYES_NO) == wxNO)
continue;
@@ -1198,13 +1198,13 @@ void CGameListCtrl::CompressSelection(bool _compress)
std::string OutputFileName;
BuildCompleteFilename(OutputFileName,
(const char *)browseDialog.GetPath().mb_str(wxConvUTF8),
WxStrToStr(browseDialog.GetPath()),
FileName);
if (wxFileExists(wxString::FromAscii(OutputFileName.c_str())) &&
if (wxFileExists(StrToWxStr(OutputFileName.c_str())) &&
wxMessageBox(
wxString::Format(_("The file %s already exists.\nDo you wish to replace it?"),
wxString(OutputFileName.c_str(), *wxConvCurrent).c_str()),
StrToWxStr(OutputFileName).c_str()),
_("Confirm File Overwrite"),
wxYES_NO) == wxNO)
continue;
@@ -1225,7 +1225,7 @@ void CGameListCtrl::CompressSelection(bool _compress)
void CGameListCtrl::CompressCB(const char* text, float percent, void* arg)
{
((wxProgressDialog*)arg)->
Update((int)(percent*1000), wxString(text, *wxConvCurrent));
Update((int)(percent*1000), StrToWxStr(text));
}
void CGameListCtrl::OnCompressGCM(wxCommandEvent& WXUNUSED (event))
@@ -1251,8 +1251,8 @@ void CGameListCtrl::OnCompressGCM(wxCommandEvent& WXUNUSED (event))
path = wxFileSelector(
_("Save decompressed GCM/ISO"),
wxString(FilePath.c_str(), *wxConvCurrent),
wxString(FileName.c_str(), *wxConvCurrent) + FileType.After('*'),
StrToWxStr(FilePath),
StrToWxStr(FileName) + FileType.After('*'),
wxEmptyString,
FileType + wxT("|") + wxGetTranslation(wxALL_FILES),
wxFD_SAVE,
@@ -1262,8 +1262,8 @@ void CGameListCtrl::OnCompressGCM(wxCommandEvent& WXUNUSED (event))
{
path = wxFileSelector(
_("Save compressed GCM/ISO"),
wxString(FilePath.c_str(), *wxConvCurrent),
wxString(FileName.c_str(), *wxConvCurrent) + _T(".gcz"),
StrToWxStr(FilePath),
StrToWxStr(FileName) + _T(".gcz"),
wxEmptyString,
_("All compressed GC/Wii ISO files (gcz)") +
wxString::Format(wxT("|*.gcz|%s"), wxGetTranslation(wxALL_FILES)),

Some files were not shown because too many files have changed in this diff Show More