Skip to content

Commit

Permalink
Merge pull request dolphin-emu#8171 from Pokechu22/backend-changing-fix
Browse files Browse the repository at this point in the history
Disallow changing the backend when running when software renderer is currently selected
  • Loading branch information
leoetlino authored Jun 20, 2019
2 parents 4edf174 + adfbbe3 commit 3cafd0a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Source/Core/DolphinQt/Config/Graphics/SoftwareRendererWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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()
Expand Down Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class SoftwareRendererWidget final : public GraphicsWidget
void ConnectWidgets();
void AddDescriptions();

void OnEmulationStateChanged(bool running);

QComboBox* m_backend_combo;
QCheckBox* m_show_statistics;
QCheckBox* m_dump_textures;
Expand Down

0 comments on commit 3cafd0a

Please sign in to comment.