mirror of https://github.com/mgba-emu/mgba.git
Qt: save shader settings when OK/Apply clicked
This commit is contained in:
parent
cca3267ef6
commit
f930184efb
|
@ -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();
|
||||
|
|
|
@ -61,6 +61,7 @@ signals:
|
|||
void pathsChanged();
|
||||
void languageChanged();
|
||||
void libraryCleared();
|
||||
void saveSettingsRequested();
|
||||
|
||||
public slots:
|
||||
void selectPage(Page);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -28,6 +28,7 @@ public:
|
|||
~ShaderSelector();
|
||||
|
||||
public slots:
|
||||
void saveSettings();
|
||||
void refreshShaders();
|
||||
void clear();
|
||||
|
||||
|
|
Loading…
Reference in New Issue