diff --git a/src/platform/qt/SettingsView.cpp b/src/platform/qt/SettingsView.cpp index c86dcf06e..f9357bbcb 100644 --- a/src/platform/qt/SettingsView.cpp +++ b/src/platform/qt/SettingsView.cpp @@ -423,8 +423,11 @@ void SettingsView::setShaderSelector(ShaderSelector* shaderSelector) { } if (!m_shader) { m_ui.stackedWidget->removeWidget(m_dummyShader); + } else { + QObject::disconnect(m_shader, nullptr, this, nullptr); } m_shader = shaderSelector; + QObject::connect(this, &SettingsView::saveSettingsRequested, m_shader, &ShaderSelector::saveSettings); if (shaderSelector) { addPage(tr("Shaders"), m_shader, Page::SHADERS); } else { @@ -683,6 +686,8 @@ void SettingsView::updateConfig() { saveSetting("gb.colors", gbColors); #endif + emit saveSettingsRequested(); + m_controller->write(); emit pathsChanged(); diff --git a/src/platform/qt/SettingsView.h b/src/platform/qt/SettingsView.h index 85cf35a99..1e45ec87a 100644 --- a/src/platform/qt/SettingsView.h +++ b/src/platform/qt/SettingsView.h @@ -61,6 +61,7 @@ signals: void pathsChanged(); void languageChanged(); void libraryCleared(); + void saveSettingsRequested(); public slots: void selectPage(Page); diff --git a/src/platform/qt/ShaderSelector.cpp b/src/platform/qt/ShaderSelector.cpp index 44bca3855..ac214349e 100644 --- a/src/platform/qt/ShaderSelector.cpp +++ b/src/platform/qt/ShaderSelector.cpp @@ -49,6 +49,10 @@ ShaderSelector::~ShaderSelector() { clear(); } +void ShaderSelector::saveSettings() { + emit saved(); +} + void ShaderSelector::clear() { m_ui.shaderName->setText(tr("No shader active")); m_ui.description->clear(); @@ -269,10 +273,6 @@ void ShaderSelector::buttonPressed(QAbstractButton* button) { case QDialogButtonBox::Reset: emit reset(); break; - case QDialogButtonBox::Ok: - emit saved(); - close(); - break; case QDialogButtonBox::RestoreDefaults: emit resetToDefault(); break; diff --git a/src/platform/qt/ShaderSelector.h b/src/platform/qt/ShaderSelector.h index 4dc9214af..0726b5edf 100644 --- a/src/platform/qt/ShaderSelector.h +++ b/src/platform/qt/ShaderSelector.h @@ -28,6 +28,7 @@ public: ~ShaderSelector(); public slots: + void saveSettings(); void refreshShaders(); void clear();