diff options
| author | Léo Lam <leo@leolam.fr> | 2021-05-02 10:52:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-02 10:52:46 +0200 |
| commit | ade9d6c954a4907962fc395fdb62a3badbafa576 (patch) | |
| tree | 6633ed488720a2b24248597ff3285513ca100cdb /Source/Core | |
| parent | 1f26b694dc824be2ba6b77ac3f5a09c916ba15f0 (diff) | |
| parent | 55ef1069f1f3ac50b2c17a0a25a49149a016ad15 (diff) | |
Merge pull request #9679 from JosJuice/disable-verify
DolphinQt: Disable verify button when emulation is running
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/DolphinQt/Config/VerifyWidget.cpp | 16 | ||||
| -rw-r--r-- | Source/Core/DolphinQt/Config/VerifyWidget.h | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt/Config/VerifyWidget.cpp b/Source/Core/DolphinQt/Config/VerifyWidget.cpp index ce221bce8f..9a2cd5a413 100644 --- a/Source/Core/DolphinQt/Config/VerifyWidget.cpp +++ b/Source/Core/DolphinQt/Config/VerifyWidget.cpp @@ -17,9 +17,11 @@ #include <QVBoxLayout> #include "Common/CommonTypes.h" +#include "Core/Core.h" #include "DiscIO/Volume.h" #include "DiscIO/VolumeVerifier.h" #include "DolphinQt/QtUtils/ParallelProgressDialog.h" +#include "DolphinQt/Settings.h" VerifyWidget::VerifyWidget(std::shared_ptr<DiscIO::Volume> volume) : m_volume(std::move(volume)) { @@ -38,6 +40,20 @@ VerifyWidget::VerifyWidget(std::shared_ptr<DiscIO::Volume> volume) : m_volume(st layout->setStretchFactor(m_summary_text, 2); setLayout(layout); + + connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, + &VerifyWidget::OnEmulationStateChanged); + + OnEmulationStateChanged(); +} + +void VerifyWidget::OnEmulationStateChanged() +{ + const bool running = Core::GetState() != 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 + m_verify_button->setEnabled(!running); } void VerifyWidget::CreateWidgets() diff --git a/Source/Core/DolphinQt/Config/VerifyWidget.h b/Source/Core/DolphinQt/Config/VerifyWidget.h index c5c6945c4f..7462d5b5e7 100644 --- a/Source/Core/DolphinQt/Config/VerifyWidget.h +++ b/Source/Core/DolphinQt/Config/VerifyWidget.h @@ -27,6 +27,9 @@ class VerifyWidget final : public QWidget public: explicit VerifyWidget(std::shared_ptr<DiscIO::Volume> volume); +private slots: + void OnEmulationStateChanged(); + private: void CreateWidgets(); std::pair<QCheckBox*, QLineEdit*> AddHashLine(QFormLayout* layout, QString text); |
