mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-14 04:38:09 -05:00
yuzu qt: Add an Apply button to configuration dialogs
Most of the code already exists to do this, but the Apply button itself was never added. This adds a button and boolean that tells yuzu to save the configuration after applying settings, even if close/Cancel is pressed on the dialog. Changes after applying will not be saved when Cancel is pressed, though.
This commit is contained in:
@ -2,8 +2,11 @@
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <QAbstractButton>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QHash>
|
||||
#include <QListWidgetItem>
|
||||
#include <QPushButton>
|
||||
#include <QSignalBlocker>
|
||||
#include "common/settings.h"
|
||||
#include "core/core.h"
|
||||
@ -31,6 +34,12 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry,
|
||||
connect(ui->selectorList, &QListWidget::itemSelectionChanged, this,
|
||||
&ConfigureDialog::UpdateVisibleTabs);
|
||||
|
||||
if (Core::System::GetInstance().IsPoweredOn()) {
|
||||
QPushButton* apply_button = ui->buttonBox->addButton(QDialogButtonBox::Apply);
|
||||
connect(apply_button, &QAbstractButton::clicked, this,
|
||||
&ConfigureDialog::HandleApplyButtonClicked);
|
||||
}
|
||||
|
||||
adjustSize();
|
||||
ui->selectorList->setCurrentRow(0);
|
||||
}
|
||||
@ -80,6 +89,11 @@ void ConfigureDialog::RetranslateUI() {
|
||||
ui->tabWidget->setCurrentIndex(old_index);
|
||||
}
|
||||
|
||||
void ConfigureDialog::HandleApplyButtonClicked() {
|
||||
UISettings::values.configuration_applied = true;
|
||||
ApplyConfiguration();
|
||||
}
|
||||
|
||||
Q_DECLARE_METATYPE(QList<QWidget*>);
|
||||
|
||||
void ConfigureDialog::PopulateSelectionList() {
|
||||
|
Reference in New Issue
Block a user