WX/Debugger: Clean up event handling

Boot to Pause and Automatic Start are not JIT or CPU menu items,
so they are supposed to be handled by OnCPUMode.
This commit is contained in:
Léo Lam 2017-07-28 12:37:21 +08:00
parent ed331918f0
commit f777c01c5d
4 changed files with 18 additions and 8 deletions

View File

@ -123,6 +123,8 @@ CCodeWindow::CCodeWindow(CFrame* parent, wxWindowID id, const wxPoint& position,
Bind(wxEVT_MENU, &CCodeWindow::OnJitMenu, this, IDM_CLEAR_CODE_CACHE, IDM_SEARCH_INSTRUCTION);
Bind(wxEVT_MENU, &CCodeWindow::OnSymbolsMenu, this, IDM_CLEAR_SYMBOLS, IDM_PATCH_HLE_FUNCTIONS);
Bind(wxEVT_MENU, &CCodeWindow::OnProfilerMenu, this, IDM_PROFILE_BLOCKS, IDM_WRITE_PROFILE);
Bind(wxEVT_MENU, &CCodeWindow::OnBootToPauseSelected, this, IDM_BOOT_TO_PAUSE);
Bind(wxEVT_MENU, &CCodeWindow::OnAutomaticStartSelected, this, IDM_AUTOMATIC_START);
// Toolbar
Bind(wxEVT_MENU, &CCodeWindow::OnCodeStep, this, IDM_STEP, IDM_GOTOPC);
@ -483,12 +485,6 @@ void CCodeWindow::OnCPUMode(wxCommandEvent& event)
case IDM_INTERPRETER:
PowerPC::SetMode(event.IsChecked() ? PowerPC::CoreMode::Interpreter : PowerPC::CoreMode::JIT);
break;
case IDM_BOOT_TO_PAUSE:
SConfig::GetInstance().bBootToPause = event.IsChecked();
return;
case IDM_AUTOMATIC_START:
SConfig::GetInstance().bAutomaticStart = event.IsChecked();
return;
case IDM_JIT_OFF:
SConfig::GetInstance().bJITOff = event.IsChecked();
break;

View File

@ -133,6 +133,9 @@ private:
void OnJitMenu(wxCommandEvent& event);
void OnProfilerMenu(wxCommandEvent& event);
void OnBootToPauseSelected(wxCommandEvent& event);
void OnAutomaticStartSelected(wxCommandEvent& event);
void OnSymbolListChange(wxCommandEvent& event);
void OnCallstackListChange(wxCommandEvent& event);
void OnCallersListChange(wxCommandEvent& event);

View File

@ -505,6 +505,16 @@ void CCodeWindow::OnChangeFont(wxCommandEvent& event)
// TODO: Send event to all panels that tells them to reload the font when it changes.
}
void CCodeWindow::OnBootToPauseSelected(wxCommandEvent& event)
{
SConfig::GetInstance().bBootToPause = event.IsChecked();
}
void CCodeWindow::OnAutomaticStartSelected(wxCommandEvent& event)
{
SConfig::GetInstance().bAutomaticStart = event.IsChecked();
}
// Toggle windows
wxPanel* CCodeWindow::GetUntypedPanel(int id) const

View File

@ -208,8 +208,6 @@ enum
// --------------------
// CPU Mode
IDM_INTERPRETER,
IDM_AUTOMATIC_START,
IDM_BOOT_TO_PAUSE,
IDM_JIT_NO_BLOCK_CACHE,
IDM_JIT_NO_BLOCK_LINKING, // JIT
IDM_JIT_OFF,
@ -223,7 +221,10 @@ enum
IDM_JIT_FP_OFF,
IDM_JIT_P_OFF,
IDM_JIT_SR_OFF,
IDM_FONT_PICKER,
IDM_AUTOMATIC_START,
IDM_BOOT_TO_PAUSE,
// Symbols
IDM_CLEAR_SYMBOLS,