mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
GCAdapter: Report libusb open errors to the user
If opening the adapter fails, report the libusb error message in the GUI instead of “No Adapter Detected”. The error condition is removed when the adapter is unplugged.
This commit is contained in:
@ -28,9 +28,25 @@ void GCPadWiiUConfigDialog::CreateLayout()
|
||||
{
|
||||
setWindowTitle(tr("GameCube Adapter for Wii U at Port %1").arg(m_port + 1));
|
||||
|
||||
const bool detected = GCAdapter::IsDetected();
|
||||
const char* error_message = nullptr;
|
||||
const bool detected = GCAdapter::IsDetected(&error_message);
|
||||
QString status_text;
|
||||
|
||||
if (detected)
|
||||
{
|
||||
status_text = tr("Adapter Detected");
|
||||
}
|
||||
else if (error_message)
|
||||
{
|
||||
status_text = tr("Error Opening Adapter: %1").arg(QString::fromUtf8(error_message));
|
||||
}
|
||||
else
|
||||
{
|
||||
status_text = tr("No Adapter Detected");
|
||||
}
|
||||
|
||||
m_layout = new QVBoxLayout();
|
||||
m_status_label = new QLabel(detected ? tr("Adapter Detected") : tr("No Adapter Detected"));
|
||||
m_status_label = new QLabel(status_text);
|
||||
m_rumble = new QCheckBox(tr("Enable Rumble"));
|
||||
m_simulate_bongos = new QCheckBox(tr("Simulate DK Bongos"));
|
||||
m_button_box = new QDialogButtonBox(QDialogButtonBox::Ok);
|
||||
|
Reference in New Issue
Block a user