mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-26 06:18:32 +00:00
GCPadWiiUConfigDialog: Update the adapter state dynamically
Update the GC adapter config GUI if the adapter is plugged or unplugged.
This commit is contained in:
parent
b08e2ec959
commit
2ac1ca133f
3 changed files with 50 additions and 25 deletions
|
@ -122,6 +122,10 @@ static int HotplugCallback(libusb_context* ctx, libusb_device* dev, libusb_hotpl
|
|||
std::lock_guard<std::mutex> lk(s_init_mutex);
|
||||
AddGCAdapter(dev);
|
||||
}
|
||||
else if (s_status < 0 && s_detect_callback != nullptr)
|
||||
{
|
||||
s_detect_callback();
|
||||
}
|
||||
}
|
||||
else if (event == LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT)
|
||||
{
|
||||
|
@ -130,7 +134,11 @@ static int HotplugCallback(libusb_context* ctx, libusb_device* dev, libusb_hotpl
|
|||
|
||||
// Reset a potential error status now that the adapter is unplugged
|
||||
if (s_status < 0)
|
||||
s_status = 0;
|
||||
{
|
||||
s_status = NO_ADAPTER_DETECTED;
|
||||
if (s_detect_callback != nullptr)
|
||||
s_detect_callback();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue