diff options
author | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2021-05-17 16:13:39 -0400 |
---|---|---|
committer | lat9nq <22451773+lat9nq@users.noreply.github.com> | 2021-05-25 02:25:39 -0400 |
commit | c1bad4357ac90de0dc25f2d4fb3ae7f9dbe138b6 (patch) | |
tree | 75b8144692a32c5f71fe08d7d2186cfe18f4d12c /src/yuzu/configuration/configure_per_game.cpp | |
parent | 7626ca3343fda069d935bf3c95b637c929b6b7ac (diff) |
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.
Diffstat (limited to 'src/yuzu/configuration/configure_per_game.cpp')
-rw-r--r-- | src/yuzu/configuration/configure_per_game.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index f550567e2..aeeb080bc 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -6,9 +6,12 @@ #include <memory> #include <utility> +#include <QAbstractButton> #include <QCheckBox> +#include <QDialogButtonBox> #include <QHeaderView> #include <QMenu> +#include <QPushButton> #include <QStandardItemModel> #include <QString> #include <QTimer> @@ -44,6 +47,12 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id) scene = new QGraphicsScene; ui->icon_view->setScene(scene); + if (Core::System::GetInstance().IsPoweredOn()) { + QPushButton* apply_button = ui->buttonBox->addButton(QDialogButtonBox::Apply); + connect(apply_button, &QAbstractButton::clicked, this, + &ConfigurePerGame::HandleApplyButtonClicked); + } + LoadConfiguration(); } @@ -76,6 +85,11 @@ void ConfigurePerGame::RetranslateUI() { ui->retranslateUi(this); } +void ConfigurePerGame::HandleApplyButtonClicked() { + UISettings::values.configuration_applied = true; + ApplyConfiguration(); +} + void ConfigurePerGame::LoadFromFile(FileSys::VirtualFile file) { this->file = std::move(file); LoadConfiguration(); |