mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 00:58:29 +02:00
Qt/MappingWindow: update devices combo box when hotplugging devices
This commit is contained in:
@ -136,6 +136,8 @@ void MappingWindow::CreateMainLayout()
|
||||
|
||||
void MappingWindow::ConnectWidgets()
|
||||
{
|
||||
connect(&Settings::Instance(), &Settings::DevicesChanged, this,
|
||||
&MappingWindow::OnGlobalDevicesChanged);
|
||||
connect(m_button_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
|
||||
connect(m_devices_refresh, &QPushButton::clicked, this, &MappingWindow::RefreshDevices);
|
||||
connect(m_devices_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||
@ -242,11 +244,15 @@ bool MappingWindow::IsMappingAllDevices() const
|
||||
}
|
||||
|
||||
void MappingWindow::RefreshDevices()
|
||||
{
|
||||
Core::RunAsCPUThread([&] { g_controller_interface.RefreshDevices(); });
|
||||
}
|
||||
|
||||
void MappingWindow::OnGlobalDevicesChanged()
|
||||
{
|
||||
m_devices_combo->clear();
|
||||
|
||||
Core::RunAsCPUThread([&] {
|
||||
g_controller_interface.RefreshDevices();
|
||||
m_controller->UpdateReferences(g_controller_interface);
|
||||
|
||||
const auto default_device = m_controller->GetDefaultDevice().ToString();
|
||||
|
Reference in New Issue
Block a user