mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 15:31:26 +12:00
Qt/Input: disable config button when device combobox is empty
This commit is contained in:
parent
ae643135b5
commit
c2379b8337
1 changed files with 7 additions and 6 deletions
|
@ -246,20 +246,21 @@ void gamepads_settings_dialog::ChangeInputType(int player)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle empty device list
|
// Handle empty device list
|
||||||
if (list_devices.size() == 0)
|
bool device_found = list_devices.size() > 0;
|
||||||
|
co_deviceID[player]->setEnabled(device_found);
|
||||||
|
|
||||||
|
if (device_found)
|
||||||
{
|
{
|
||||||
co_deviceID[player]->addItem(tr("No Device Detected"), -1);
|
co_deviceID[player]->setCurrentText(qstr(device));
|
||||||
co_deviceID[player]->setEnabled(false);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
co_deviceID[player]->setEnabled(true);
|
co_deviceID[player]->addItem(tr("No Device Detected"), -1);
|
||||||
co_deviceID[player]->setCurrentText(qstr(device));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update view and enable configuration if possible
|
// Update view and enable configuration if possible
|
||||||
resizeComboBoxView(co_deviceID[player]);
|
resizeComboBoxView(co_deviceID[player]);
|
||||||
bu_config[player]->setEnabled(cur_pad_handler->has_config());
|
bu_config[player]->setEnabled(device_found && cur_pad_handler->has_config());
|
||||||
}
|
}
|
||||||
|
|
||||||
void gamepads_settings_dialog::ClickConfigButton(int player)
|
void gamepads_settings_dialog::ClickConfigButton(int player)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue