summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp
diff options
context:
space:
mode:
authorGlenn Rice <glennricster@gmail.com>2011-02-28 20:40:15 +0000
committerGlenn Rice <glennricster@gmail.com>2011-02-28 20:40:15 +0000
commitba54fac9eb74be6f73e20e2de953cf6f355be57f (patch)
treeee496d869da4f8a7026b94991fe33f560cb9851a /Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp
parent1b8f4760247934e3bac649d45a887d304b5eb724 (diff)
Convert GetUserPath to return a std::string instead of a const char *. This simplifies its usage in most cases.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7265 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp')
-rw-r--r--Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp36
1 files changed, 20 insertions, 16 deletions
diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp
index 786475fb29..e0f59f5813 100644
--- a/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp
+++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindowFunctions.cpp
@@ -18,16 +18,8 @@
#include "Common.h"
#include "CommonPaths.h"
-#include <wx/button.h>
-#include <wx/textctrl.h>
-#include <wx/textdlg.h>
-#include <wx/listctrl.h>
-#include <wx/thread.h>
-#include <wx/mstream.h>
-#include <wx/tipwin.h>
#include <wx/fontdlg.h>
-
-#include "../../DolphinWX/Src/WxUtils.h"
+#include <wx/mimetype.h>
#include "Host.h"
@@ -165,7 +157,6 @@ void CCodeWindow::CreateMenuSymbols(wxMenuBar *pMenuBar)
{
wxMenu *pSymbolsMenu = new wxMenu;
pSymbolsMenu->Append(IDM_CLEARSYMBOLS, _("&Clear symbols"));
- // pSymbolsMenu->Append(IDM_CLEANSYMBOLS, _("&Clean symbols (zz)"));
pSymbolsMenu->Append(IDM_SCANFUNCTIONS, _("&Generate symbol map"));
pSymbolsMenu->AppendSeparator();
pSymbolsMenu->Append(IDM_LOADMAPFILE, _("&Load symbol map"));
@@ -207,8 +198,25 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event)
Profiler::g_ProfileBlocks = GetMenuBar()->IsChecked(IDM_PROFILEBLOCKS);
break;
case IDM_WRITEPROFILE:
- Profiler::WriteProfileResults("profiler.txt");
- WxUtils::Launch("profiler.txt");
+ if (jit != NULL)
+ {
+ std::string filename = File::GetUserPath(D_DUMP_IDX) + "Debug/profiler.txt";
+ File::CreateFullPath(filename.c_str());
+ Profiler::WriteProfileResults(filename.c_str());
+
+ wxFileType* filetype = NULL;
+ if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromExtension(_T("txt"))))
+ {
+ // From extension failed, trying with MIME type now
+ if (!(filetype = wxTheMimeTypesManager->GetFileTypeFromMimeType(_T("text/plain"))))
+ // MIME type failed, aborting mission
+ break;
+ }
+ wxString OpenCommand;
+ OpenCommand = filetype->GetOpenCommand(wxString::From8BitData(filename.c_str()));
+ if(!OpenCommand.IsEmpty())
+ wxExecute(OpenCommand, wxEXEC_SYNC);
+ }
break;
}
}
@@ -227,10 +235,6 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
g_symbolDB.Clear();
Host_NotifyMapLoaded();
break;
- case IDM_CLEANSYMBOLS:
- g_symbolDB.Clear("zz");
- Host_NotifyMapLoaded();
- break;
case IDM_SCANFUNCTIONS:
{
PPCAnalyst::FindFunctions(0x80000000, 0x81800000, &g_symbolDB);