From fe8f836668c4a9df25e620543a4c1815b3ae720c Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Mon, 8 Apr 2024 22:55:20 -0700 Subject: [PATCH] VerifyWidget: Listen for Core::State OnEmulationStateChanged --- Source/Core/DolphinQt/Config/VerifyWidget.cpp | 6 +++--- Source/Core/DolphinQt/Config/VerifyWidget.h | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/Core/DolphinQt/Config/VerifyWidget.cpp b/Source/Core/DolphinQt/Config/VerifyWidget.cpp index 291ae0bb6c..2588682a1c 100644 --- a/Source/Core/DolphinQt/Config/VerifyWidget.cpp +++ b/Source/Core/DolphinQt/Config/VerifyWidget.cpp @@ -45,12 +45,12 @@ VerifyWidget::VerifyWidget(std::shared_ptr volume) : m_volume(st connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &VerifyWidget::OnEmulationStateChanged); - OnEmulationStateChanged(); + OnEmulationStateChanged(Core::GetState(Core::System::GetInstance())); } -void VerifyWidget::OnEmulationStateChanged() +void VerifyWidget::OnEmulationStateChanged(Core::State state) { - const bool running = Core::GetState(Core::System::GetInstance()) != Core::State::Uninitialized; + const bool running = state != Core::State::Uninitialized; // Verifying a Wii game while emulation is running doesn't work correctly // due to verification of a Wii game creating an instance of IOS diff --git a/Source/Core/DolphinQt/Config/VerifyWidget.h b/Source/Core/DolphinQt/Config/VerifyWidget.h index 29b26d5fc3..c2b2868d74 100644 --- a/Source/Core/DolphinQt/Config/VerifyWidget.h +++ b/Source/Core/DolphinQt/Config/VerifyWidget.h @@ -15,6 +15,10 @@ #include #include +namespace Core +{ +enum class State; +} namespace DiscIO { class Volume; @@ -26,10 +30,8 @@ class VerifyWidget final : public QWidget public: explicit VerifyWidget(std::shared_ptr volume); -private slots: - void OnEmulationStateChanged(); - private: + void OnEmulationStateChanged(Core::State state); void CreateWidgets(); std::pair AddHashLine(QFormLayout* layout, QString text); void ConnectWidgets();