diff --git a/Source/Core/Core/Src/Host.h b/Source/Core/Core/Src/Host.h index dc141c2743..1c73c9079e 100644 --- a/Source/Core/Core/Src/Host.h +++ b/Source/Core/Core/Src/Host.h @@ -51,5 +51,6 @@ void Host_SetWaitCursor(bool enable); void Host_UpdateStatusBar(const char* _pText); void Host_SysMessage(const char *fmt, ...); +void Host_SetWiiMoteConnectionState(int _State); #endif diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp index b89f597e05..5914c5520b 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp @@ -19,6 +19,7 @@ #include "../Plugins/Plugin_Wiimote.h" #include "../Debugger/Debugger_SymbolMap.h" +#include "../Host.h" // ugly hacks for "SendEventNumberOfCompletedPackets" int g_HCICount = 0; @@ -51,6 +52,8 @@ CWII_IPC_HLE_Device_usb_oh1_57e_305::CWII_IPC_HLE_Device_usb_oh1_57e_305(u32 _De m_ClassOfDevice[2] = 0x00; memset(m_LocalName, 0, HCI_UNIT_NAME_SIZE); + + Host_SetWiiMoteConnectionState(0); } CWII_IPC_HLE_Device_usb_oh1_57e_305::~CWII_IPC_HLE_Device_usb_oh1_57e_305() @@ -333,6 +336,7 @@ u32 CWII_IPC_HLE_Device_usb_oh1_57e_305::Update() { if (m_WiiMotes[i].EventPagingChanged(2)) { + Host_SetWiiMoteConnectionState(1); SendEventRequestConnection(m_WiiMotes[i]); } } @@ -1193,7 +1197,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandReadStoredLinkKey(u8* _Input) LOG(WIIMOTE, " num_keys_read: %i", Reply.num_keys_read); // generate link key - for (int i=0; iSendACLFrame(GetConnectionHandle(), DataFrame, Offset); + + // + Host_SetWiiMoteConnectionState(2); } diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h index 940f987ac8..810bea8fb2 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h @@ -127,12 +127,10 @@ private: bool m_HIDControlChannel_Connected; bool m_HIDControlChannel_ConnectedWait; bool m_HIDControlChannel_Config; - bool m_HIDControlChannelHost_Config; bool m_HIDControlChannel_ConfigWait; bool m_HIDInterruptChannel_Connected; bool m_HIDInterruptChannel_ConnectedWait; bool m_HIDInterruptChannel_Config; - bool m_HIDInterruptChannelHost_Config; bool m_HIDInterruptChannel_ConfigWait; diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index 15dc334048..3f1f322a02 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -146,7 +146,9 @@ CFrame::CFrame(wxFrame* parent, SetIcon(IconTemp); // Give it a status line - m_pStatusBar = CreateStatusBar(); + m_pStatusBar = CreateStatusBar(2); + int StylesField[] = {wxSB_FLAT, wxSB_FLAT}; + m_pStatusBar->SetStatusStyles(2, StylesField); CreateMenu(); // This panel is the parent for rendering and it holds the gamelistctrl @@ -541,7 +543,7 @@ void CFrame::OnHostMessage(wxCommandEvent& event) case IDM_UPDATESTATUSBAR: if (m_pStatusBar != NULL) { - m_pStatusBar->SetStatusText(event.GetString()); + m_pStatusBar->SetStatusText(event.GetString(), event.GetInt()); } break; } diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index dd3db422a8..ccbfce69cb 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -302,6 +302,7 @@ void Host_UpdateStatusBar(const char* _pText) { wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATESTATUSBAR); event.SetString(wxString::FromAscii(_pText)); + event.SetInt(0); wxPostEvent(main_frame, event); } @@ -318,3 +319,24 @@ void Host_SysMessage(const char *fmt, ...) if (msg[strlen(msg)-1] == '\n') msg[strlen(msg)-1] = 0; wxMessageBox(wxString::FromAscii(msg)); } + +void Host_SetWiiMoteConnectionState(int _State) +{ + static int currentState = -1; + if (_State == currentState) + return; + currentState = _State; + + wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_UPDATESTATUSBAR); + + switch(_State) + { + case 0: event.SetString(wxString::FromAscii("not connected")); break; + case 1: event.SetString(wxString::FromAscii("connecting...")); break; + case 2: event.SetString(wxString::FromAscii("conected!")); break; + } + + event.SetInt(1); + + wxPostEvent(main_frame, event); +} \ No newline at end of file