Merge pull request #2744 from mathieui/gcadapter-stopthread

GCAdapter: Disable the scanning thread when direct connect is disabled
This commit is contained in:
skidau 2015-07-15 11:29:37 +10:00
commit 41bdaece5e
3 changed files with 8 additions and 1 deletions

View File

@ -146,11 +146,13 @@ void Init()
if (ret) if (ret)
{ {
ERROR_LOG(SERIALINTERFACE, "libusb_init failed with error: %d", ret); ERROR_LOG(SERIALINTERFACE, "libusb_init failed with error: %d", ret);
s_libusb_driver_not_supported = true;
Shutdown(); Shutdown();
} }
else else
{ {
StartScanThread(); if (SConfig::GetInstance().m_GameCubeAdapter)
StartScanThread();
} }
} }

View File

@ -174,6 +174,7 @@ wxStaticBoxSizer* ControllerConfigDiag::CreateGamecubeSizer()
m_adapter_status->SetLabelText(_("Driver Not Detected")); m_adapter_status->SetLabelText(_("Driver Not Detected"));
gamecube_adapter->Disable(); gamecube_adapter->Disable();
gamecube_adapter->SetValue(false); gamecube_adapter->SetValue(false);
gamecube_rumble->Disable();
} }
} }
else else

View File

@ -73,6 +73,10 @@ private:
void OnGameCubeAdapter(wxCommandEvent& event) void OnGameCubeAdapter(wxCommandEvent& event)
{ {
SConfig::GetInstance().m_GameCubeAdapter = event.IsChecked(); SConfig::GetInstance().m_GameCubeAdapter = event.IsChecked();
if (event.IsChecked())
SI_GCAdapter::StartScanThread();
else
SI_GCAdapter::StopScanThread();
event.Skip(); event.Skip();
} }
void OnAdapterRumble(wxCommandEvent& event) void OnAdapterRumble(wxCommandEvent& event)