GUI: Made the symbols menu talk more

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4181 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2009-09-03 09:13:41 +00:00
parent 486798c580
commit 8cd6e1d409
4 changed files with 30 additions and 9 deletions

View File

@ -23,6 +23,8 @@
#include "../HW/Memmap.h"
#include "../PowerPC/PowerPC.h"
#include "../Host.h"
#include "StringUtil.h"
#include "PPCSymbolDB.h"
#include "SignatureDB.h"
#include "PPCAnalyst.h"
@ -274,6 +276,16 @@ bool PPCSymbolDB::SaveMap(const char *filename, bool WithCodes) const
std::string mapFile = filename;
if (WithCodes) mapFile = mapFile.substr(0, mapFile.find_last_of(".")) + "_code.map";
// Check size
const int wxYES_NO = 0x00000002 | 0x00000008;
if (functions.size() == 0)
{
if(!AskYesNo(StringFromFormat(
"No symbol names are generated. Do you want to replace '%s' with a blank file?",
mapFile.c_str()).c_str(), "Confirm", wxYES_NO)) return false;
}
if (WithCodes) Host_UpdateStatusBar("Saving code, please stand by ...");
// Make a file
FILE *f = fopen(mapFile.c_str(), "w");
if (!f) return false;
@ -330,11 +342,12 @@ bool PPCSymbolDB::SaveMap(const char *filename, bool WithCodes) const
debugger->disasm(Address, disasm, 256);
fprintf(f,"%08x %i %20s %s\n", Address, 0, TempSym.c_str(), disasm);
}
fprintf(f, "\n"); // Write a blank line after each block
// Write a blank line after each block
fprintf(f, "\n");
}
}
// ---------------
SuccessAlert("Saved %s", mapFile.c_str());
Host_UpdateStatusBar(StringFromFormat("Saved %s", mapFile.c_str()).c_str());
fclose(f);
return true;
}

View File

@ -232,15 +232,13 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
{
Parent->ClearStatusBar();
if (Core::GetState() == Core::CORE_UNINITIALIZED)
{
// TODO: disable menu items instead :P
return;
}
if (Core::GetState() == Core::CORE_UNINITIALIZED) return;
std::string mapfile = CBoot::GenerateMapFilename();
switch (event.GetId())
{
case IDM_CLEARSYMBOLS:
if(!AskYesNo("Do you want to clear the list of symbol names?", "Confirm", wxYES_NO)) return;
g_symbolDB.Clear();
Host_NotifyMapLoaded();
break;
@ -253,9 +251,16 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
PPCAnalyst::FindFunctions(0x80000000, 0x80400000, &g_symbolDB);
SignatureDB db;
if (db.Load((File::GetSysDirectory() + TOTALDB).c_str()))
{
db.Apply(&g_symbolDB);
Parent->StatusBarMessage("Generated symbol names from '%s'", TOTALDB);
}
else
{
Parent->StatusBarMessage("'%s' not found, no symbol names generated", TOTALDB);
}
// HLE::PatchFunctions();
// Update GUI
NotifyMapLoaded();
break;
}

View File

@ -629,7 +629,7 @@ void CFrame::DoStop()
{
// Ask for confirmation in case the user accidently clicked Stop / Escape
if(SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop)
if(!AskYesNo("Are you sure you want to stop the current emulation?", "Confirm", wxYES_NO))
if(!AskYesNo("Do want to stop the current emulation?", "Confirm", wxYES_NO))
return;
// TODO: Show the author/description dialog here

View File

@ -518,7 +518,10 @@ void Host_UpdateStatusBar(const char* _pText, int Field)
event.SetInt(Field);
// Post message
// TODO : this has been said to cause hang (??) how is that even possible ? :d
event.StopPropagation();
wxPostEvent(main_frame, event);
// Process the event before continue
wxYieldIfNeeded();
}
void Host_SetWiiMoteConnectionState(int _State)