From 8833e2a7fa35b5754eae1b18eab93d0515a4ae16 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 26 Oct 2019 17:50:54 +0200 Subject: [PATCH] DolphinQt: Call OnEmulationStateChanged when creating config window panes Otherwise UI elements won't be disabled correctly if the config window is first opened while a game is running. --- Source/Core/DolphinQt/Settings/AudioPane.cpp | 2 ++ Source/Core/DolphinQt/Settings/GeneralPane.cpp | 2 ++ Source/Core/DolphinQt/Settings/WiiPane.cpp | 1 + 3 files changed, 5 insertions(+) diff --git a/Source/Core/DolphinQt/Settings/AudioPane.cpp b/Source/Core/DolphinQt/Settings/AudioPane.cpp index 4d780a3e1b..8c3df4ec76 100644 --- a/Source/Core/DolphinQt/Settings/AudioPane.cpp +++ b/Source/Core/DolphinQt/Settings/AudioPane.cpp @@ -37,6 +37,8 @@ AudioPane::AudioPane() connect(&Settings::Instance(), &Settings::VolumeChanged, this, &AudioPane::OnVolumeChanged); connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [=](Core::State state) { OnEmulationStateChanged(state != Core::State::Uninitialized); }); + + OnEmulationStateChanged(Core::GetState() != Core::State::Uninitialized); } void AudioPane::CreateWidgets() diff --git a/Source/Core/DolphinQt/Settings/GeneralPane.cpp b/Source/Core/DolphinQt/Settings/GeneralPane.cpp index c1140cf98f..1d8cc485a7 100644 --- a/Source/Core/DolphinQt/Settings/GeneralPane.cpp +++ b/Source/Core/DolphinQt/Settings/GeneralPane.cpp @@ -50,6 +50,8 @@ GeneralPane::GeneralPane(QWidget* parent) : QWidget(parent) connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &GeneralPane::OnEmulationStateChanged); + + OnEmulationStateChanged(Core::GetState()); } void GeneralPane::CreateLayout() diff --git a/Source/Core/DolphinQt/Settings/WiiPane.cpp b/Source/Core/DolphinQt/Settings/WiiPane.cpp index 87c44f793c..671808edc1 100644 --- a/Source/Core/DolphinQt/Settings/WiiPane.cpp +++ b/Source/Core/DolphinQt/Settings/WiiPane.cpp @@ -48,6 +48,7 @@ WiiPane::WiiPane(QWidget* parent) : QWidget(parent) LoadConfig(); ConnectLayout(); ValidateSelectionState(); + OnEmulationStateChanged(Core::GetState() != Core::State::Uninitialized); } void WiiPane::CreateLayout()