diff options
| -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 639d5df0f..ae8cac243 100644 --- a/src/yuzu/configuration/configure_gamelist.cpp +++ b/src/yuzu/configuration/configure_gamelist.cpp | |||
| @@ -36,6 +36,16 @@ ConfigureGameList::ConfigureGameList(QWidget* parent) | |||
| 36 | InitializeRowComboBoxes(); | 36 | InitializeRowComboBoxes(); |
| 37 | 37 | ||
| 38 | this->setConfiguration(); | 38 | this->setConfiguration(); |
| 39 | |||
| 40 | // Force game list reload if any of the relevant settings are changed. | ||
| 41 | connect(ui->show_unknown, &QCheckBox::stateChanged, this, | ||
| 42 | &ConfigureGameList::RequestGameListUpdate); | ||
| 43 | connect(ui->icon_size_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, | ||
| 44 | &ConfigureGameList::RequestGameListUpdate); | ||
| 45 | connect(ui->row_1_text_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, | ||
| 46 | &ConfigureGameList::RequestGameListUpdate); | ||
| 47 | connect(ui->row_2_text_combobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, | ||
| 48 | &ConfigureGameList::RequestGameListUpdate); | ||
| 39 | } | 49 | } |
| 40 | 50 | ||
| 41 | ConfigureGameList::~ConfigureGameList() = default; | 51 | ConfigureGameList::~ConfigureGameList() = default; |
| @@ -49,6 +59,10 @@ void ConfigureGameList::applyConfiguration() { | |||
| 49 | Settings::Apply(); | 59 | Settings::Apply(); |
| 50 | } | 60 | } |
| 51 | 61 | ||
| 62 | void ConfigureGameList::RequestGameListUpdate() { | ||
| 63 | UISettings::values.is_game_list_reload_pending.exchange(true); | ||
| 64 | } | ||
| 65 | |||
| 52 | void ConfigureGameList::setConfiguration() { | 66 | void ConfigureGameList::setConfiguration() { |
| 53 | ui->show_unknown->setChecked(UISettings::values.show_unknown); | 67 | ui->show_unknown->setChecked(UISettings::values.show_unknown); |
| 54 | ui->show_add_ons->setChecked(UISettings::values.show_add_ons); | 68 | ui->show_add_ons->setChecked(UISettings::values.show_add_ons); |
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: | |||
| 21 | void applyConfiguration(); | 21 | void applyConfiguration(); |
| 22 | 22 | ||
| 23 | private: | 23 | private: |
| 24 | void RequestGameListUpdate(); | ||
| 25 | |||
| 24 | void setConfiguration(); | 26 | void setConfiguration(); |
| 25 | 27 | ||
| 26 | void changeEvent(QEvent*) override; | 28 | void changeEvent(QEvent*) override; |
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 314f51203..c22742007 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -23,6 +23,9 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) | |||
| 23 | 23 | ||
| 24 | this->setConfiguration(); | 24 | this->setConfiguration(); |
| 25 | 25 | ||
| 26 | connect(ui->toggle_deepscan, &QCheckBox::stateChanged, this, | ||
| 27 | [] { UISettings::values.is_game_list_reload_pending.exchange(true); }); | ||
| 28 | |||
| 26 | ui->use_cpu_jit->setEnabled(!Core::System::GetInstance().IsPoweredOn()); | 29 | ui->use_cpu_jit->setEnabled(!Core::System::GetInstance().IsPoweredOn()); |
| 27 | } | 30 | } |
| 28 | 31 | ||
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 999086e7f..4b969119c 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1341,7 +1341,13 @@ void GMainWindow::OnConfigure() { | |||
| 1341 | UpdateUITheme(); | 1341 | UpdateUITheme(); |
| 1342 | if (UISettings::values.enable_discord_presence != old_discord_presence) | 1342 | if (UISettings::values.enable_discord_presence != old_discord_presence) |
| 1343 | SetDiscordEnabled(UISettings::values.enable_discord_presence); | 1343 | SetDiscordEnabled(UISettings::values.enable_discord_presence); |
| 1344 | game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan); | 1344 | |
| 1345 | const auto reload = UISettings::values.is_game_list_reload_pending.exchange(false); | ||
| 1346 | if (reload) { | ||
| 1347 | game_list->PopulateAsync(UISettings::values.gamedir, | ||
| 1348 | UISettings::values.gamedir_deepscan); | ||
| 1349 | } | ||
| 1350 | |||
| 1345 | config->Save(); | 1351 | config->Save(); |
| 1346 | } | 1352 | } |
| 1347 | } | 1353 | } |
diff --git a/src/yuzu/ui_settings.h b/src/yuzu/ui_settings.h index 32a0d813c..e80aebc0a 100644 --- a/src/yuzu/ui_settings.h +++ b/src/yuzu/ui_settings.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <atomic> | ||
| 8 | #include <vector> | 9 | #include <vector> |
| 9 | #include <QByteArray> | 10 | #include <QByteArray> |
| 10 | #include <QString> | 11 | #include <QString> |
| @@ -63,6 +64,7 @@ struct Values { | |||
| 63 | uint32_t icon_size; | 64 | uint32_t icon_size; |
| 64 | uint8_t row_1_text_id; | 65 | uint8_t row_1_text_id; |
| 65 | uint8_t row_2_text_id; | 66 | uint8_t row_2_text_id; |
| 67 | std::atomic_bool is_game_list_reload_pending{false}; | ||
| 66 | }; | 68 | }; |
| 67 | 69 | ||
| 68 | extern Values values; | 70 | extern Values values; |