From 6370f094ba951f5397a8a2b34a38bef97050c25f Mon Sep 17 00:00:00 2001 From: spycrab Date: Sun, 21 May 2017 14:47:35 +0200 Subject: [PATCH] Qt: Fix default device handling --- Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp | 2 +- Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp index f4bfc00f80..12c1b939fc 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingButton.cpp @@ -54,7 +54,7 @@ GetExpressionForControl(const QString& control_name, void MappingButton::OnButtonPressed() { - if (m_block) + if (m_block || m_parent->GetDevice() == nullptr) return; // Make sure that we don't block event handling diff --git a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp index 657b3ef43c..af0fde8475 100644 --- a/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp +++ b/Source/Core/DolphinQt2/Config/Mapping/MappingWindow.cpp @@ -211,7 +211,9 @@ void MappingWindow::OnSaveProfilePressed() 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() @@ -234,6 +236,8 @@ void MappingWindow::RefreshDevices() m_devices_combo->addItem(QString::fromStdString(name)); } + m_devices_combo->setCurrentIndex(0); + Core::PauseAndLock(false, paused); }