mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-09 15:49:25 +01:00
Merge pull request #6907 from spycrab/qt_gfx_sr_backend
Qt/SoftwareRendererWidget: Fix backend info not getting updated properly
This commit is contained in:
commit
07e0b9c0d2
@ -201,12 +201,6 @@ void GeneralWidget::SaveSettings()
|
||||
return;
|
||||
}
|
||||
}
|
||||
SConfig::GetInstance().m_strVideoBackend = current_backend;
|
||||
|
||||
g_Config.Refresh();
|
||||
|
||||
g_video_backend = backend.get();
|
||||
g_video_backend->InitBackendInfo();
|
||||
emit BackendChanged(QString::fromStdString(current_backend));
|
||||
break;
|
||||
}
|
||||
|
@ -94,17 +94,31 @@ void GraphicsWindow::CreateMainLayout()
|
||||
setLayout(main_layout);
|
||||
}
|
||||
|
||||
void GraphicsWindow::OnBackendChanged(const QString& backend)
|
||||
void GraphicsWindow::OnBackendChanged(const QString& backend_name)
|
||||
{
|
||||
SConfig::GetInstance().m_strVideoBackend = backend_name.toStdString();
|
||||
|
||||
for (const auto& backend : g_available_video_backends)
|
||||
{
|
||||
if (backend->GetName() == backend_name.toStdString())
|
||||
{
|
||||
g_Config.Refresh();
|
||||
|
||||
g_video_backend = backend.get();
|
||||
g_video_backend->InitBackendInfo();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
setWindowTitle(tr("%1 Graphics Configuration")
|
||||
.arg(QString::fromStdString(g_video_backend->GetDisplayName())));
|
||||
if (backend == QStringLiteral("Software Renderer") && m_tab_widget->count() > 1)
|
||||
if (backend_name == QStringLiteral("Software Renderer") && m_tab_widget->count() > 1)
|
||||
{
|
||||
m_tab_widget->clear();
|
||||
m_tab_widget->addTab(m_wrapped_software, tr("Software Renderer"));
|
||||
}
|
||||
|
||||
if (backend != QStringLiteral("Software Renderer") && m_tab_widget->count() == 1)
|
||||
if (backend_name != QStringLiteral("Software Renderer") && m_tab_widget->count() == 1)
|
||||
{
|
||||
m_tab_widget->clear();
|
||||
m_tab_widget->addTab(m_wrapped_general, tr("General"));
|
||||
@ -113,7 +127,7 @@ void GraphicsWindow::OnBackendChanged(const QString& backend)
|
||||
m_tab_widget->addTab(m_wrapped_advanced, tr("Advanced"));
|
||||
}
|
||||
|
||||
emit BackendChanged(backend);
|
||||
emit BackendChanged(backend_name);
|
||||
}
|
||||
|
||||
void GraphicsWindow::RegisterWidget(GraphicsWidget* widget)
|
||||
|
@ -133,10 +133,7 @@ void SoftwareRendererWidget::SaveSettings()
|
||||
{
|
||||
const auto backend_name = backend->GetName();
|
||||
if (backend_name != SConfig::GetInstance().m_strVideoBackend)
|
||||
{
|
||||
SConfig::GetInstance().m_strVideoBackend = backend_name;
|
||||
emit BackendChanged(QString::fromStdString(backend_name));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user