diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-11-04 01:38:39 +0100 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-11-04 01:38:39 +0100 |
commit | 52e7e8eed3daee0de13f7ab114c87cedd3e2a46b (patch) | |
tree | 9d42f7ddf9a22651d280c63a9cad4a4a3e3f2801 /src | |
parent | Merge pull request #1636 from ogniK5377/hwopus-bad-assert (diff) | |
download | yuzu-52e7e8eed3daee0de13f7ab114c87cedd3e2a46b.tar yuzu-52e7e8eed3daee0de13f7ab114c87cedd3e2a46b.tar.gz yuzu-52e7e8eed3daee0de13f7ab114c87cedd3e2a46b.tar.bz2 yuzu-52e7e8eed3daee0de13f7ab114c87cedd3e2a46b.tar.lz yuzu-52e7e8eed3daee0de13f7ab114c87cedd3e2a46b.tar.xz yuzu-52e7e8eed3daee0de13f7ab114c87cedd3e2a46b.tar.zst yuzu-52e7e8eed3daee0de13f7ab114c87cedd3e2a46b.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/yuzu/configuration/configure_gamelist.cpp | 14 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_gamelist.h | 2 | ||||
-rw-r--r-- | src/yuzu/configuration/configure_general.cpp | 3 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 8 | ||||
-rw-r--r-- | src/yuzu/ui_settings.h | 2 |
5 files changed, 28 insertions, 1 deletions
diff --git a/src/yuzu/configuration/configure_gamelist.cpp b/src/yuzu/configuration/configure_gamelist.cpp index 8743ce982..0112bd950 100644 --- a/src/yuzu/configuration/configure_gamelist.cpp +++ b/src/yuzu/configuration/configure_gamelist.cpp @@ -36,6 +36,16 @@ ConfigureGameList::ConfigureGameList(QWidget* parent) InitializeRowComboBoxes(); this->setConfiguration(); + + // Force game list reload if any of the relevant settings are changed. + connect(ui->show_unknown, &QCheckBox::stateChanged, this, + &ConfigureGameList::RequestGameListUpdate); + connect(ui->icon_size_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, + &ConfigureGameList::RequestGameListUpdate); + connect(ui->row_1_text_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, + &ConfigureGameList::RequestGameListUpdate); + connect(ui->row_2_text_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, + &ConfigureGameList::RequestGameListUpdate); } ConfigureGameList::~ConfigureGameList() = default; @@ -48,6 +58,10 @@ void ConfigureGameList::applyConfiguration() { Settings::Apply(); } +void ConfigureGameList::RequestGameListUpdate() { + UISettings::values.is_game_list_reload_pending.exchange(true); +} + void ConfigureGameList::setConfiguration() { ui->show_unknown->setChecked(UISettings::values.show_unknown); ui->icon_size_combobox->setCurrentIndex( diff --git a/src/yuzu/configuration/configure_gamelist.h b/src/yuzu/configuration/configure_gamelist.h index ff7406c60..bbf7e25f1 100644 --- a/src/yuzu/configuration/configure_gamelist.h +++ b/src/yuzu/configuration/configure_gamelist.h @@ -21,6 +21,8 @@ public: void applyConfiguration(); private: + void RequestGameListUpdate(); + void setConfiguration(); void changeEvent(QEvent*) override; diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 537d6e576..8e77558fa 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp @@ -19,6 +19,9 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) this->setConfiguration(); + connect(ui->toggle_deepscan, &QCheckBox::stateChanged, this, + [] { UISettings::values.is_game_list_reload_pending.exchange(true); }); + ui->use_cpu_jit->setEnabled(!Core::System::GetInstance().IsPoweredOn()); ui->use_docked_mode->setEnabled(!Core::System::GetInstance().IsPoweredOn()); } diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index c5a56cbfd..e9253493b 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -1328,7 +1328,13 @@ void GMainWindow::OnConfigure() { UpdateUITheme(); if (UISettings::values.enable_discord_presence != old_discord_presence) SetDiscordEnabled(UISettings::values.enable_discord_presence); - game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan); + + const auto reload = UISettings::values.is_game_list_reload_pending.exchange(false); + if (reload) { + game_list->PopulateAsync(UISettings::values.gamedir, + UISettings::values.gamedir_deepscan); + } + config->Save(); } } diff --git a/src/yuzu/ui_settings.h b/src/yuzu/ui_settings.h index 2e617d52a..af1c9432f 100644 --- a/src/yuzu/ui_settings.h +++ b/src/yuzu/ui_settings.h @@ -5,6 +5,7 @@ #pragma once #include <array> +#include <atomic> #include <vector> #include <QByteArray> #include <QString> @@ -62,6 +63,7 @@ struct Values { uint32_t icon_size; uint8_t row_1_text_id; uint8_t row_2_text_id; + std::atomic_bool is_game_list_reload_pending{false}; }; extern Values values; |