FrameTools: Disable hotkeys while a modal dialog is shown.

This commit is contained in:
Jules Blok 2015-07-23 09:09:01 +02:00
parent 0092f5207b
commit 75fc213359

View File

@ -1153,7 +1153,9 @@ void CFrame::DoStop()
wxYES_NO | wxSTAY_ON_TOP | wxICON_EXCLAMATION, wxYES_NO | wxSTAY_ON_TOP | wxICON_EXCLAMATION,
wxDefaultPosition); wxDefaultPosition);
HotkeyManagerEmu::Enable(false);
int Ret = m_StopDlg.ShowModal(); int Ret = m_StopDlg.ShowModal();
HotkeyManagerEmu::Enable(true);
if (Ret != wxID_YES) if (Ret != wxID_YES)
{ {
Core::SetState(state); Core::SetState(state);
@ -1297,29 +1299,37 @@ void CFrame::OnReset(wxCommandEvent& WXUNUSED (event))
void CFrame::OnConfigMain(wxCommandEvent& WXUNUSED (event)) void CFrame::OnConfigMain(wxCommandEvent& WXUNUSED (event))
{ {
CConfigMain ConfigMain(this); CConfigMain ConfigMain(this);
HotkeyManagerEmu::Enable(false);
if (ConfigMain.ShowModal() == wxID_OK) if (ConfigMain.ShowModal() == wxID_OK)
m_GameListCtrl->Update(); m_GameListCtrl->Update();
HotkeyManagerEmu::Enable(true);
UpdateGUI(); UpdateGUI();
} }
void CFrame::OnConfigGFX(wxCommandEvent& WXUNUSED (event)) void CFrame::OnConfigGFX(wxCommandEvent& WXUNUSED (event))
{ {
HotkeyManagerEmu::Enable(false);
if (g_video_backend) if (g_video_backend)
g_video_backend->ShowConfig(this); g_video_backend->ShowConfig(this);
HotkeyManagerEmu::Enable(true);
} }
void CFrame::OnConfigAudio(wxCommandEvent& WXUNUSED (event)) void CFrame::OnConfigAudio(wxCommandEvent& WXUNUSED (event))
{ {
CConfigMain ConfigMain(this); CConfigMain ConfigMain(this);
ConfigMain.SetSelectedTab(CConfigMain::ID_AUDIOPAGE); ConfigMain.SetSelectedTab(CConfigMain::ID_AUDIOPAGE);
HotkeyManagerEmu::Enable(false);
if (ConfigMain.ShowModal() == wxID_OK) if (ConfigMain.ShowModal() == wxID_OK)
m_GameListCtrl->Update(); m_GameListCtrl->Update();
HotkeyManagerEmu::Enable(true);
} }
void CFrame::OnConfigControllers(wxCommandEvent& WXUNUSED (event)) void CFrame::OnConfigControllers(wxCommandEvent& WXUNUSED (event))
{ {
ControllerConfigDiag config_dlg(this); ControllerConfigDiag config_dlg(this);
HotkeyManagerEmu::Enable(false);
config_dlg.ShowModal(); config_dlg.ShowModal();
HotkeyManagerEmu::Enable(true);
} }
void CFrame::OnConfigHotkey(wxCommandEvent& WXUNUSED (event)) void CFrame::OnConfigHotkey(wxCommandEvent& WXUNUSED (event))
@ -1364,7 +1374,9 @@ void CFrame::OnHelp(wxCommandEvent& event)
case wxID_ABOUT: case wxID_ABOUT:
{ {
AboutDolphin frame(this); AboutDolphin frame(this);
HotkeyManagerEmu::Enable(false);
frame.ShowModal(); frame.ShowModal();
HotkeyManagerEmu::Enable(true);
} }
break; break;
case IDM_HELP_WEBSITE: case IDM_HELP_WEBSITE:
@ -1424,7 +1436,9 @@ void CFrame::OnNetPlay(wxCommandEvent& WXUNUSED (event))
void CFrame::OnMemcard(wxCommandEvent& WXUNUSED (event)) void CFrame::OnMemcard(wxCommandEvent& WXUNUSED (event))
{ {
CMemcardManager MemcardManager(this); CMemcardManager MemcardManager(this);
HotkeyManagerEmu::Enable(false);
MemcardManager.ShowModal(); MemcardManager.ShowModal();
HotkeyManagerEmu::Enable(true);
} }
void CFrame::OnExportAllSaves(wxCommandEvent& WXUNUSED (event)) void CFrame::OnExportAllSaves(wxCommandEvent& WXUNUSED (event))