Permalink
Browse files

Merge pull request #6861 from spycrab/qt_adapter_save

Qt/GeneralWidget: Restore the adapter properly
  • Loading branch information...
spycrab committed May 15, 2018
2 parents b432484 + e922f91 commit 71f5fafb3b498cb03e4cc317fff927434f223f26
Showing with 10 additions and 3 deletions.
  1. +10 −3 Source/Core/DolphinQt2/Config/Graphics/GeneralWidget.cpp
@@ -131,7 +131,12 @@ void GeneralWidget::ConnectWidgets()
{
// Video Backend
connect(m_backend_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
[this](int) { SaveSettings(); });
this, &GeneralWidget::SaveSettings);
connect(m_adapter_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, [](int index) {
g_Config.iAdapter = index;
Config::SetBaseOrCurrent(Config::GFX_ADAPTER, index);
});
for (QCheckBox* checkbox : {m_enable_fullscreen, m_render_main_window, m_autoadjust_window_size})
connect(checkbox, &QCheckBox::toggled, this, &GeneralWidget::SaveSettings);
@@ -163,8 +168,6 @@ void GeneralWidget::LoadSettings()
void GeneralWidget::SaveSettings()
{
g_Config.iAdapter = m_adapter_combo->currentIndex();
// Video Backend
for (const auto& backend : g_available_video_backends)
{
@@ -329,6 +332,8 @@ void GeneralWidget::OnBackendChanged(const QString& backend_name)
}
}
const bool old = m_adapter_combo->blockSignals(true);
m_adapter_combo->clear();
const auto& adapters = g_Config.backend_info.Adapters;
@@ -338,4 +343,6 @@ void GeneralWidget::OnBackendChanged(const QString& backend_name)
m_adapter_combo->setCurrentIndex(g_Config.iAdapter);
m_adapter_combo->setEnabled(!adapters.empty());
m_adapter_combo->blockSignals(old);
}

0 comments on commit 71f5faf

Please sign in to comment.