summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2013-03-03 19:56:36 -0600
committerJordan Woyak <jordan.woyak@gmail.com>2013-03-03 19:56:36 -0600
commitfcf87f6c53fd26b4dcbba5151185f3c4f4d4bd1d (patch)
tree08fd3277db552867f251bed449400f68387ac6f6 /Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp
parentcedfa452b4497590f828306b42b1e7c24915fd58 (diff)
parent814c2ffdfd213dfa78078471d298e2657b7e14e9 (diff)
Merge branch 'windows-unicode'
Fixed unicode filename handling on Windows. Made all significant projects build with "Unicode" option on Windows. Fixed unicode string handling in GUI code on all OSes. From now on: std::string == UTF-8. Fixed issue 4111. Fixed issue 5178. Fixed issue 5980.
Diffstat (limited to 'Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp')
-rw-r--r--Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp
index 706b398dce..ef4622d14f 100644
--- a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp
+++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp
@@ -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));
// 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"
@@ -208,7 +209,7 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event)
break;
}
wxString OpenCommand;
- OpenCommand = filetype->GetOpenCommand(wxString::From8BitData(filename.c_str()));
+ OpenCommand = filetype->GetOpenCommand(StrToWxStr(filename));
if(!OpenCommand.IsEmpty())
wxExecute(OpenCommand, wxEXEC_SYNC);
}
@@ -284,7 +285,8 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
if (!path.IsEmpty())
{
- std::ifstream f(path.mb_str());
+ std::ifstream f;
+ OpenFStream(f, WxStrToStr(path), std::ios_base::in);
std::string line;
while (std::getline(f, line))
@@ -312,13 +314,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 +330,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 +344,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 +367,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));
symbols->SetClientData(idx, (void*)&iter->second);
}
symbols->Thaw();