mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Qt/MappingWindow: update devices combo box when hotplugging devices
This commit is contained in:
parent
b689a195ff
commit
ce98a9c71d
@ -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();
|
||||
|
@ -76,6 +76,7 @@ private:
|
||||
void OnSaveProfilePressed();
|
||||
void OnDefaultFieldsPressed();
|
||||
void OnDeviceChanged(int index);
|
||||
void OnGlobalDevicesChanged();
|
||||
|
||||
ControllerEmu::EmulatedController* m_controller = nullptr;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user