Merge pull request #12696 from mitaclaw/verify-widget-core-state-slot

VerifyWidget: Listen for Core::State OnEmulationStateChanged
This commit is contained in:
Admiral H. Curtiss 2024-04-13 01:39:32 +02:00 committed by GitHub
commit d58c998d6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 6 deletions

View File

@ -45,12 +45,12 @@ VerifyWidget::VerifyWidget(std::shared_ptr<DiscIO::Volume> volume) : m_volume(st
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
&VerifyWidget::OnEmulationStateChanged); &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 // Verifying a Wii game while emulation is running doesn't work correctly
// due to verification of a Wii game creating an instance of IOS // due to verification of a Wii game creating an instance of IOS

View File

@ -15,6 +15,10 @@
#include <QTextEdit> #include <QTextEdit>
#include <QWidget> #include <QWidget>
namespace Core
{
enum class State;
}
namespace DiscIO namespace DiscIO
{ {
class Volume; class Volume;
@ -26,10 +30,8 @@ class VerifyWidget final : public QWidget
public: public:
explicit VerifyWidget(std::shared_ptr<DiscIO::Volume> volume); explicit VerifyWidget(std::shared_ptr<DiscIO::Volume> volume);
private slots:
void OnEmulationStateChanged();
private: private:
void OnEmulationStateChanged(Core::State state);
void CreateWidgets(); void CreateWidgets();
std::pair<QCheckBox*, QLineEdit*> AddHashLine(QFormLayout* layout, QString text); std::pair<QCheckBox*, QLineEdit*> AddHashLine(QFormLayout* layout, QString text);
void ConnectWidgets(); void ConnectWidgets();