Fixed the crash that would occur when the Refresh button was pressed in the controllers config.

- Simplified the locking mechanism when controllers were updated
- Reloaded the config of the controls instead of re-initialising the control plugins
- Fixed controls being unresponsive after the Refresh button was pressed
- Disables the hotkeys while the controller config is open
This commit is contained in:
skidau
2015-03-05 19:49:10 +11:00
parent b446ea0132
commit 780eef68f6
16 changed files with 93 additions and 104 deletions

View File

@ -44,6 +44,10 @@
#include "Common/FileUtil.h"
#include "Common/IniFile.h"
#include "Common/MsgHandler.h"
#include "Core/Core.h"
#include "Core/HotkeyManager.h"
#include "Core/HW/GCKeyboard.h"
#include "Core/HW/GCPad.h"
#include "Core/HW/Wiimote.h"
#include "DolphinWX/InputConfigDiag.h"
#include "DolphinWX/WxUtils.h"
@ -740,6 +744,8 @@ void InputConfigDialog::UpdateDeviceComboBox()
void GamepadPage::RefreshDevices(wxCommandEvent&)
{
bool was_unpaused = Core::PauseAndLock(true);
std::lock_guard<std::recursive_mutex> lk(m_config.controls_lock);
// refresh devices
@ -750,6 +756,14 @@ void GamepadPage::RefreshDevices(wxCommandEvent&)
// update device cbox
m_config_dialog->UpdateDeviceComboBox();
//if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
Wiimote::LoadConfig();
Keyboard::LoadConfig();
Pad::LoadConfig();
HotkeyManagerEmu::LoadConfig();
Core::PauseAndLock(false, was_unpaused);
}
ControlGroupBox::~ControlGroupBox()