summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2019-06-20 13:58:01 +0200
committerGitHub <noreply@github.com>2019-06-20 13:58:01 +0200
commit3cafd0ae814b4403b06bbce4a698efdf0068de6e (patch)
treeb7abd94438ca50a84cf6405c528a132067317119 /Source
parent4edf174b615d51d2d7815be43e1a8880886103f0 (diff)
parentadfbbe3a023696db354daf5964399102ffe8d130 (diff)
Merge pull request #8171 from Pokechu22/backend-changing-fix
Disallow changing the backend when running when software renderer is currently selected
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/SoftwareRendererWidget.cpp15
-rw-r--r--Source/Core/DolphinQt/Config/Graphics/SoftwareRendererWidget.h2
2 files changed, 14 insertions, 3 deletions
diff --git a/Source/Core/DolphinQt/Config/Graphics/SoftwareRendererWidget.cpp b/Source/Core/DolphinQt/Config/Graphics/SoftwareRendererWidget.cpp
index 4941d1b556..1e2496d2f7 100644
--- a/Source/Core/DolphinQt/Config/Graphics/SoftwareRendererWidget.cpp
+++ b/Source/Core/DolphinQt/Config/Graphics/SoftwareRendererWidget.cpp
@@ -13,6 +13,7 @@
#include "Core/Config/GraphicsSettings.h"
#include "Core/ConfigManager.h"
+#include "Core/Core.h"
#include "DolphinQt/Config/Graphics/GraphicsBool.h"
#include "DolphinQt/Config/Graphics/GraphicsWindow.h"
@@ -26,12 +27,15 @@
SoftwareRendererWidget::SoftwareRendererWidget(GraphicsWindow* parent) : GraphicsWidget(parent)
{
CreateWidgets();
-
- connect(parent, &GraphicsWindow::BackendChanged, [this] { LoadSettings(); });
-
LoadSettings();
ConnectWidgets();
AddDescriptions();
+ emit BackendChanged(QString::fromStdString(SConfig::GetInstance().m_strVideoBackend));
+
+ connect(parent, &GraphicsWindow::BackendChanged, [this] { LoadSettings(); });
+ connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
+ [=](Core::State state) { OnEmulationStateChanged(state != Core::State::Uninitialized); });
+ OnEmulationStateChanged(Core::GetState() != Core::State::Uninitialized);
}
void SoftwareRendererWidget::CreateWidgets()
@@ -180,3 +184,8 @@ void SoftwareRendererWidget::AddDescriptions()
AddDescription(m_dump_tev_stages, TR_DUMP_TEV_STAGES_DESCRIPTION);
AddDescription(m_dump_tev_fetches, TR_DUMP_TEV_FETCHES_DESCRIPTION);
}
+
+void SoftwareRendererWidget::OnEmulationStateChanged(bool running)
+{
+ m_backend_combo->setEnabled(!running);
+}
diff --git a/Source/Core/DolphinQt/Config/Graphics/SoftwareRendererWidget.h b/Source/Core/DolphinQt/Config/Graphics/SoftwareRendererWidget.h
index df328ec5ec..5b3ce64b5b 100644
--- a/Source/Core/DolphinQt/Config/Graphics/SoftwareRendererWidget.h
+++ b/Source/Core/DolphinQt/Config/Graphics/SoftwareRendererWidget.h
@@ -28,6 +28,8 @@ private:
void ConnectWidgets();
void AddDescriptions();
+ void OnEmulationStateChanged(bool running);
+
QComboBox* m_backend_combo;
QCheckBox* m_show_statistics;
QCheckBox* m_dump_textures;