Merge pull request #5462 from spycrab/qt_refresh_devices
Qt: Fix default device handling
This commit is contained in:
commit
e328b13ae2
|
@ -54,7 +54,7 @@ GetExpressionForControl(const QString& control_name,
|
||||||
|
|
||||||
void MappingButton::OnButtonPressed()
|
void MappingButton::OnButtonPressed()
|
||||||
{
|
{
|
||||||
if (m_block)
|
if (m_block || m_parent->GetDevice() == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Make sure that we don't block event handling
|
// Make sure that we don't block event handling
|
||||||
|
|
|
@ -211,7 +211,9 @@ void MappingWindow::OnSaveProfilePressed()
|
||||||
|
|
||||||
void MappingWindow::OnDeviceChanged(int index)
|
void MappingWindow::OnDeviceChanged(int index)
|
||||||
{
|
{
|
||||||
m_devq.FromString(m_devices_combo->currentText().toStdString());
|
const auto device = m_devices_combo->currentText().toStdString();
|
||||||
|
m_devq.FromString(device);
|
||||||
|
m_controller->default_device.FromString(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MappingWindow::RefreshDevices()
|
void MappingWindow::RefreshDevices()
|
||||||
|
@ -234,6 +236,8 @@ void MappingWindow::RefreshDevices()
|
||||||
m_devices_combo->addItem(QString::fromStdString(name));
|
m_devices_combo->addItem(QString::fromStdString(name));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_devices_combo->setCurrentIndex(0);
|
||||||
|
|
||||||
Core::PauseAndLock(false, paused);
|
Core::PauseAndLock(false, paused);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue