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;
|
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));
|
emit BackendChanged(QString::fromStdString(current_backend));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -94,17 +94,31 @@ void GraphicsWindow::CreateMainLayout()
|
||||||
setLayout(main_layout);
|
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")
|
setWindowTitle(tr("%1 Graphics Configuration")
|
||||||
.arg(QString::fromStdString(g_video_backend->GetDisplayName())));
|
.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->clear();
|
||||||
m_tab_widget->addTab(m_wrapped_software, tr("Software Renderer"));
|
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->clear();
|
||||||
m_tab_widget->addTab(m_wrapped_general, tr("General"));
|
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"));
|
m_tab_widget->addTab(m_wrapped_advanced, tr("Advanced"));
|
||||||
}
|
}
|
||||||
|
|
||||||
emit BackendChanged(backend);
|
emit BackendChanged(backend_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsWindow::RegisterWidget(GraphicsWidget* widget)
|
void GraphicsWindow::RegisterWidget(GraphicsWidget* widget)
|
||||||
|
|
|
@ -133,10 +133,7 @@ void SoftwareRendererWidget::SaveSettings()
|
||||||
{
|
{
|
||||||
const auto backend_name = backend->GetName();
|
const auto backend_name = backend->GetName();
|
||||||
if (backend_name != SConfig::GetInstance().m_strVideoBackend)
|
if (backend_name != SConfig::GetInstance().m_strVideoBackend)
|
||||||
{
|
|
||||||
SConfig::GetInstance().m_strVideoBackend = backend_name;
|
|
||||||
emit BackendChanged(QString::fromStdString(backend_name));
|
emit BackendChanged(QString::fromStdString(backend_name));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue