From 670ca7e993277178d09d2c5b131b51210d20a607 Mon Sep 17 00:00:00 2001 From: rog Date: Sat, 29 Dec 2012 02:43:36 -0500 Subject: [PATCH] Toggle wiimote status based on the actual status, instead of some dumb checkbox that is almost never even right. The checkbox is still wrong when starting emulation, but it's now purely cosmetic. Actually fixes issue 5594. --- Source/Core/DolphinWX/Src/FrameTools.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 9207144554..b79e890f3b 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -1469,13 +1469,17 @@ void CFrame::ConnectWiimote(int wm_idx, bool connect) wxString msg(wxString::Format(wxT("Wiimote %i %s"), wm_idx + 1, connect ? wxT("Connected") : wxT("Disconnected"))); Core::DisplayMessage(msg.ToAscii(), 3000); + + // Wait for the wiimote to connect + while (GetUsbPointer()->AccessWiiMote(wm_idx | 0x100)->IsConnected() != connect) + {} Host_UpdateMainFrame(); } } void CFrame::OnConnectWiimote(wxCommandEvent& event) { - ConnectWiimote(event.GetId() - IDM_CONNECT_WIIMOTE1, event.IsChecked()); + ConnectWiimote(event.GetId() - IDM_CONNECT_WIIMOTE1, !GetUsbPointer()->AccessWiiMote((event.GetId() - IDM_CONNECT_WIIMOTE1) | 0x100)->IsConnected()); } // Toogle fullscreen. In Windows the fullscreen mode is accomplished by expanding the m_Panel to cover