GUI: Fixed boot settings

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4180 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2009-09-03 07:59:24 +00:00
parent c82c0b0b93
commit 486798c580
6 changed files with 63 additions and 46 deletions

View File

@ -303,10 +303,6 @@ void CCodeWindow::OnCodeViewChange(wxCommandEvent &event)
void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event) void CCodeWindow::OnAddrBoxChange(wxCommandEvent& event)
{ {
ConsoleListener* Console = LogManager::GetInstance()->getConsoleListener();
Console->Log(LogTypes::LNOTICE, StringFromFormat(
"GetToolBar():%i\n", GetToolBar()).c_str());
if (!GetToolBar()) return; if (!GetToolBar()) return;
wxTextCtrl* pAddrCtrl = (wxTextCtrl*)GetToolBar()->FindControl(IDM_ADDRBOX); wxTextCtrl* pAddrCtrl = (wxTextCtrl*)GetToolBar()->FindControl(IDM_ADDRBOX);

View File

@ -230,6 +230,8 @@ void CCodeWindow::OnProfilerMenu(wxCommandEvent& event)
void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
{ {
Parent->ClearStatusBar();
if (Core::GetState() == Core::CORE_UNINITIALIZED) if (Core::GetState() == Core::CORE_UNINITIALIZED)
{ {
// TODO: disable menu items instead :P // TODO: disable menu items instead :P
@ -265,8 +267,12 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
SignatureDB db; SignatureDB db;
if (db.Load((File::GetSysDirectory() + TOTALDB).c_str())) if (db.Load((File::GetSysDirectory() + TOTALDB).c_str()))
db.Apply(&g_symbolDB); db.Apply(&g_symbolDB);
} else { Parent->StatusBarMessage("'%s' not found, scanning for common functions instead", mapfile.c_str());
}
else
{
g_symbolDB.LoadMap(mapfile.c_str()); g_symbolDB.LoadMap(mapfile.c_str());
Parent->StatusBarMessage("Loaded symbols from '%s'", mapfile.c_str());
} }
HLE::PatchFunctions(); HLE::PatchFunctions();
NotifyMapLoaded(); NotifyMapLoaded();

View File

@ -63,7 +63,6 @@
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
extern CFrame* main_frame; extern CFrame* main_frame;
extern CCodeWindow* g_pCodeWindow;
#endif #endif
namespace BootManager namespace BootManager
@ -83,21 +82,21 @@ bool BootCore(const std::string& _rFilename)
// Use custom settings for debugging mode // Use custom settings for debugging mode
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
if (g_pCodeWindow) if (main_frame->g_pCodeWindow)
{ {
// StartUp.bUseDualCore = code_frame->UseDualCore(); //StartUp.bUseDualCore = code_frame->UseDualCore();
StartUp.bUseJIT = !g_pCodeWindow->UseInterpreter(); StartUp.bUseJIT = !main_frame->g_pCodeWindow->UseInterpreter();
StartUp.bBootToPause = g_pCodeWindow->BootToPause(); StartUp.bBootToPause = main_frame->g_pCodeWindow->BootToPause();
StartUp.bAutomaticStart = g_pCodeWindow->AutomaticStart(); StartUp.bAutomaticStart = main_frame->g_pCodeWindow->AutomaticStart();
StartUp.bJITUnlimitedCache = g_pCodeWindow->UnlimitedJITCache(); StartUp.bJITUnlimitedCache = main_frame->g_pCodeWindow->UnlimitedJITCache();
StartUp.bJITBlockLinking = g_pCodeWindow->JITBlockLinking(); StartUp.bJITBlockLinking = main_frame->g_pCodeWindow->JITBlockLinking();
} }
else else
{ {
// StartUp.bUseDualCore = false; //StartUp.bUseDualCore = false;
// StartUp.bUseJIT = true; //StartUp.bUseJIT = true;
} }
StartUp.bEnableDebugging = g_pCodeWindow ? true : false; // RUNNING_DEBUG StartUp.bEnableDebugging = main_frame->g_pCodeWindow ? true : false; // RUNNING_DEBUG
#endif #endif
StartUp.m_BootType = SCoreStartupParameter::BOOT_ISO; StartUp.m_BootType = SCoreStartupParameter::BOOT_ISO;
@ -193,8 +192,7 @@ bool BootCore(const std::string& _rFilename)
#if defined(HAVE_WX) && HAVE_WX #if defined(HAVE_WX) && HAVE_WX
// Boot to pause or not // Boot to pause or not
Core::SetState((g_pCodeWindow && StartUp.bBootToPause) Core::SetState((main_frame->g_pCodeWindow && StartUp.bBootToPause) ? Core::CORE_PAUSE : Core::CORE_RUN);
? Core::CORE_PAUSE : Core::CORE_RUN);
#else #else
Core::SetState(Core::CORE_RUN); Core::SetState(Core::CORE_RUN);
#endif #endif

View File

@ -79,6 +79,8 @@ class CFrame : public wxFrame
void PostEvent(wxCommandEvent& event); void PostEvent(wxCommandEvent& event);
void PostMenuEvent(wxMenuEvent& event); void PostMenuEvent(wxMenuEvent& event);
void PostUpdateUIEvent(wxUpdateUIEvent& event); void PostUpdateUIEvent(wxUpdateUIEvent& event);
void StatusBarMessage(char * Text, ...);
void ClearStatusBar();
// --------------------------------------- // ---------------------------------------
// Wiimote leds // Wiimote leds
@ -216,7 +218,6 @@ class CFrame : public wxFrame
void PopulateToolbarAui(wxAuiToolBar* toolBar); void PopulateToolbarAui(wxAuiToolBar* toolBar);
void RecreateToolbar(); void RecreateToolbar();
void CreateMenu(); void CreateMenu();
void ClearStatusBar();
wxPanel *CreateEmptyPanel(); wxPanel *CreateEmptyPanel();
wxAuiNotebook *CreateEmptyNotebook(); wxAuiNotebook *CreateEmptyNotebook();

View File

@ -714,7 +714,18 @@ void CFrame::ClearStatusBar()
{ {
if (this->GetStatusBar()->IsEnabled()) this->GetStatusBar()->SetStatusText(wxT(""),0); if (this->GetStatusBar()->IsEnabled()) this->GetStatusBar()->SetStatusText(wxT(""),0);
} }
void CFrame::StatusBarMessage(char * Text, ...)
{
const int MAX_BYTES = 1024*10;
char Str[MAX_BYTES];
va_list ArgPtr;
int Cnt;
va_start(ArgPtr, Text);
Cnt = vsnprintf(Str, MAX_BYTES, Text, ArgPtr);
va_end(ArgPtr);
if (this->GetStatusBar()->IsEnabled()) this->GetStatusBar()->SetStatusText(wxString::FromAscii(Str),0);
}
// Miscellaneous menus // Miscellaneous menus

View File

@ -50,7 +50,6 @@ IMPLEMENT_APP(DolphinApp)
#endif #endif
CFrame* main_frame = NULL; CFrame* main_frame = NULL;
CCodeWindow* g_pCodeWindow = NULL;
LogManager *logManager = NULL; LogManager *logManager = NULL;
#ifdef WIN32 #ifdef WIN32
@ -348,6 +347,26 @@ void DolphinApp::OnEndSession()
} }
/////////////////////////////////////// Main window created /////////////////////////////////////// Main window created
// g_VideoInitialize.pSysMessage() goes here
void Host_SysMessage(const char *fmt, ...)
{
va_list list;
char msg[512];
va_start(list, fmt);
vsprintf(msg, fmt, list);
va_end(list);
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
//wxMessageBox(wxString::FromAscii(msg));
PanicAlert("%s", msg);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Talk to GUI
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯
#if defined HAVE_WX && HAVE_WX #if defined HAVE_WX && HAVE_WX
bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*/) bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*/)
{ {
@ -355,7 +374,6 @@ bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*
wxString::FromAscii(caption), wxString::FromAscii(caption),
(yes_no)?wxYES_NO:wxOK); (yes_no)?wxYES_NO:wxOK);
} }
#endif
// Accessor for the main window class // Accessor for the main window class
CFrame* DolphinApp::GetCFrame() CFrame* DolphinApp::GetCFrame()
@ -370,9 +388,9 @@ void Host_NotifyMapLoaded()
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_NOTIFYMAPLOADED); wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_NOTIFYMAPLOADED);
wxPostEvent(main_frame, event); wxPostEvent(main_frame, event);
if (g_pCodeWindow) if (main_frame->g_pCodeWindow)
{ {
wxPostEvent(g_pCodeWindow, event); wxPostEvent(main_frame->g_pCodeWindow, event);
} }
} }
@ -382,9 +400,9 @@ void Host_UpdateLogDisplay()
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATELOGDISPLAY); wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATELOGDISPLAY);
wxPostEvent(main_frame, event); wxPostEvent(main_frame, event);
if (g_pCodeWindow) if (main_frame->g_pCodeWindow)
{ {
wxPostEvent(g_pCodeWindow, event); wxPostEvent(main_frame->g_pCodeWindow, event);
} }
} }
@ -394,9 +412,9 @@ void Host_UpdateDisasmDialog()
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEDISASMDIALOG); wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEDISASMDIALOG);
wxPostEvent(main_frame, event); wxPostEvent(main_frame, event);
if (g_pCodeWindow) if (main_frame->g_pCodeWindow)
{ {
wxPostEvent(g_pCodeWindow, event); wxPostEvent(main_frame->g_pCodeWindow, event);
} }
} }
@ -411,9 +429,9 @@ void Host_UpdateMainFrame()
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEGUI); wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEGUI);
wxPostEvent(main_frame, event); wxPostEvent(main_frame, event);
if (g_pCodeWindow) if (main_frame->g_pCodeWindow)
{ {
wxPostEvent(g_pCodeWindow, event); wxPostEvent(main_frame->g_pCodeWindow, event);
} }
} }
// Remove this? // Remove this?
@ -422,9 +440,9 @@ void Host_UpdateBreakPointView()
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEBREAKPOINTS); wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATEBREAKPOINTS);
wxPostEvent(main_frame, event); wxPostEvent(main_frame, event);
if (g_pCodeWindow) if (main_frame->g_pCodeWindow)
{ {
wxPostEvent(g_pCodeWindow, event); wxPostEvent(main_frame->g_pCodeWindow, event);
} }
} }
@ -503,21 +521,6 @@ void Host_UpdateStatusBar(const char* _pText, int Field)
wxPostEvent(main_frame, event); wxPostEvent(main_frame, event);
} }
// g_VideoInitialize.pSysMessage() goes here
void Host_SysMessage(const char *fmt, ...)
{
va_list list;
char msg[512];
va_start(list, fmt);
vsprintf(msg, fmt, list);
va_end(list);
if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0;
//wxMessageBox(wxString::FromAscii(msg));
PanicAlert("%s", msg);
}
void Host_SetWiiMoteConnectionState(int _State) void Host_SetWiiMoteConnectionState(int _State)
{ {
static int currentState = -1; static int currentState = -1;
@ -542,3 +545,5 @@ void Host_SetWiiMoteConnectionState(int _State)
wxPostEvent(main_frame, event); wxPostEvent(main_frame, event);
} }
#endif // HAVE_WX
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////