From 31d409c8b16d9676dd78681db43dc851c4e54000 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 9 Sep 2015 01:44:31 -0700 Subject: [PATCH] Qt: Add 'Apply' button to settings window (fixes #103) --- CHANGES | 1 + src/platform/qt/SettingsView.cpp | 5 +++++ src/platform/qt/SettingsView.ui | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 504fccb97..a62101b35 100644 --- a/CHANGES +++ b/CHANGES @@ -20,6 +20,7 @@ Misc: - GBA Audio: Allow GBAAVStream to have no video callback - ARM7: Force disable LTO on two files to work around a GCC bug - Libretro: Use anonymous memory mappers for large blocks of memory + - Qt: Add 'Apply' button to settings window 0.3.0: (2015-08-16) Features: diff --git a/src/platform/qt/SettingsView.cpp b/src/platform/qt/SettingsView.cpp index 244d25b9a..23c370f34 100644 --- a/src/platform/qt/SettingsView.cpp +++ b/src/platform/qt/SettingsView.cpp @@ -89,6 +89,11 @@ SettingsView::SettingsView(ConfigController* controller, QWidget* parent) connect(m_ui.biosBrowse, SIGNAL(clicked()), this, SLOT(selectBios())); connect(m_ui.buttonBox, SIGNAL(accepted()), this, SLOT(updateConfig())); + connect(m_ui.buttonBox, &QDialogButtonBox::clicked, [this](QAbstractButton* button) { + if (m_ui.buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) { + updateConfig(); + } + }); } void SettingsView::selectBios() { diff --git a/src/platform/qt/SettingsView.ui b/src/platform/qt/SettingsView.ui index f9302a87c..ed0765fd0 100644 --- a/src/platform/qt/SettingsView.ui +++ b/src/platform/qt/SettingsView.ui @@ -549,7 +549,7 @@ - QDialogButtonBox::Cancel|QDialogButtonBox::Ok + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok