From d3b94d64d492407dcd43acf79cd1e94d57630109 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Fri, 5 May 2023 23:30:59 -0400 Subject: configuration: Add base class to tabs Tabs that largely configure SwitchableSetting's are now Tabs and grouped together. --- src/yuzu/configuration/configure_per_game.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'src/yuzu/configuration/configure_per_game.cpp') diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index eb96e6068..c54d7e76f 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -24,6 +24,7 @@ #include "core/loader/loader.h" #include "ui_configure_per_game.h" #include "yuzu/configuration/config.h" +#include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_audio.h" #include "yuzu/configuration/configure_cpu.h" #include "yuzu/configuration/configure_general.h" @@ -40,22 +41,23 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name, std::vector& vk_device_records, Core::System& system_) - : QDialog(parent), - ui(std::make_unique()), title_id{title_id_}, system{system_} { + : QDialog(parent), ui(std::make_unique()), title_id{title_id_}, + system{system_}, group{std::make_shared>()} { const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name)); const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()) : fmt::format("{:016X}", title_id); game_config = std::make_unique(config_file_name, Config::ConfigType::PerGameConfig); addons_tab = std::make_unique(system_, this); - audio_tab = std::make_unique(system_, this); - cpu_tab = std::make_unique(system_, this); - general_tab = std::make_unique(system_, this); - graphics_advanced_tab = std::make_unique(system_, this); + audio_tab = std::make_unique(system_, group, this); + cpu_tab = std::make_unique(system_, group, this); + general_tab = std::make_unique(system_, group, this); + graphics_advanced_tab = std::make_unique(system_, group, this); graphics_tab = std::make_unique( - system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, this); + system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, group, + this); input_tab = std::make_unique(system_, game_config.get(), this); - system_tab = std::make_unique(system_, this); + system_tab = std::make_unique(system_, group, this); ui->setupUi(this); @@ -88,13 +90,10 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st ConfigurePerGame::~ConfigurePerGame() = default; void ConfigurePerGame::ApplyConfiguration() { + for (const auto tab : *group) { + tab->ApplyConfiguration(); + } addons_tab->ApplyConfiguration(); - general_tab->ApplyConfiguration(); - cpu_tab->ApplyConfiguration(); - system_tab->ApplyConfiguration(); - graphics_tab->ApplyConfiguration(); - graphics_advanced_tab->ApplyConfiguration(); - audio_tab->ApplyConfiguration(); input_tab->ApplyConfiguration(); system.ApplySettings(); -- cgit v1.2.3 From b11b4be7cb764bc0c1aa6c563ccf41a3d1b335dd Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Fri, 5 May 2023 23:31:24 -0400 Subject: configure_per_game: Rename group to tab_group --- src/yuzu/configuration/configure_per_game.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/yuzu/configuration/configure_per_game.cpp') diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index c54d7e76f..7ec0bf9d3 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -42,22 +42,22 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st std::vector& vk_device_records, Core::System& system_) : QDialog(parent), ui(std::make_unique()), title_id{title_id_}, - system{system_}, group{std::make_shared>()} { + system{system_}, tab_group{std::make_shared>()} { const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name)); const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()) : fmt::format("{:016X}", title_id); game_config = std::make_unique(config_file_name, Config::ConfigType::PerGameConfig); addons_tab = std::make_unique(system_, this); - audio_tab = std::make_unique(system_, group, this); - cpu_tab = std::make_unique(system_, group, this); - general_tab = std::make_unique(system_, group, this); - graphics_advanced_tab = std::make_unique(system_, group, this); + audio_tab = std::make_unique(system_, tab_group, this); + cpu_tab = std::make_unique(system_, tab_group, this); + general_tab = std::make_unique(system_, tab_group, this); + graphics_advanced_tab = std::make_unique(system_, tab_group, this); graphics_tab = std::make_unique( - system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, group, - this); + system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, + tab_group, this); input_tab = std::make_unique(system_, game_config.get(), this); - system_tab = std::make_unique(system_, group, this); + system_tab = std::make_unique(system_, tab_group, this); ui->setupUi(this); @@ -90,7 +90,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st ConfigurePerGame::~ConfigurePerGame() = default; void ConfigurePerGame::ApplyConfiguration() { - for (const auto tab : *group) { + for (const auto tab : *tab_group) { tab->ApplyConfiguration(); } addons_tab->ApplyConfiguration(); -- cgit v1.2.3 From a007ac6b9ccc23861f5a5c6967d535220ed794b0 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Sun, 7 May 2023 09:48:26 -0400 Subject: configure_graphics_advance: Generate UI at runtime We can iterate through the AdvancedGraphics settings and generate the UI during runtime. This doesn't help runtime efficiency, but it helps a ton in reducing the amount of work a developer needs in order to add a new setting. --- src/yuzu/configuration/configure_per_game.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/yuzu/configuration/configure_per_game.cpp') diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index 7ec0bf9d3..339768017 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -41,8 +41,10 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name, std::vector& vk_device_records, Core::System& system_) - : QDialog(parent), ui(std::make_unique()), title_id{title_id_}, - system{system_}, tab_group{std::make_shared>()} { + : QDialog(parent), + ui(std::make_unique()), title_id{title_id_}, system{system_}, + translations{ConfigurationShared::InitializeTranslations(this)}, + tab_group{std::make_shared>()} { const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name)); const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()) : fmt::format("{:016X}", title_id); @@ -52,7 +54,8 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st audio_tab = std::make_unique(system_, tab_group, this); cpu_tab = std::make_unique(system_, tab_group, this); general_tab = std::make_unique(system_, tab_group, this); - graphics_advanced_tab = std::make_unique(system_, tab_group, this); + graphics_advanced_tab = + std::make_unique(system_, tab_group, *translations, this); graphics_tab = std::make_unique( system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, tab_group, this); -- cgit v1.2.3 From f8435d676f0073dee4d2ea87c84767a53911fbe6 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Sun, 7 May 2023 12:03:40 -0400 Subject: configure_graphics: Partial runtime implementation --- src/yuzu/configuration/configure_per_game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/configuration/configure_per_game.cpp') diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index 339768017..9e229977d 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -58,7 +58,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st std::make_unique(system_, tab_group, *translations, this); graphics_tab = std::make_unique( system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, - tab_group, this); + tab_group, *translations, this); input_tab = std::make_unique(system_, game_config.get(), this); system_tab = std::make_unique(system_, tab_group, this); -- cgit v1.2.3 From 827082c5ac30ff488016d168e3ca93021eb612e4 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Tue, 9 May 2023 01:38:01 -0400 Subject: configure_general: Generate UI using containers This leaves per-game config's General tab empty? --- src/yuzu/configuration/configure_per_game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/configuration/configure_per_game.cpp') diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index 9e229977d..05da9bda0 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -53,7 +53,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st addons_tab = std::make_unique(system_, this); audio_tab = std::make_unique(system_, tab_group, this); cpu_tab = std::make_unique(system_, tab_group, this); - general_tab = std::make_unique(system_, tab_group, this); + general_tab = std::make_unique(system_, tab_group, *translations, this); graphics_advanced_tab = std::make_unique(system_, tab_group, *translations, this); graphics_tab = std::make_unique( -- cgit v1.2.3 From 56960bf9f8ff6987fe265d98fe60852d9b7b05b4 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Tue, 9 May 2023 17:05:08 -0400 Subject: per_game: Remove general tab It's empty. --- src/yuzu/configuration/configure_per_game.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/yuzu/configuration/configure_per_game.cpp') diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index 05da9bda0..5548fc2ba 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -27,7 +27,6 @@ #include "yuzu/configuration/configuration_shared.h" #include "yuzu/configuration/configure_audio.h" #include "yuzu/configuration/configure_cpu.h" -#include "yuzu/configuration/configure_general.h" #include "yuzu/configuration/configure_graphics.h" #include "yuzu/configuration/configure_graphics_advanced.h" #include "yuzu/configuration/configure_input_per_game.h" @@ -53,7 +52,6 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st addons_tab = std::make_unique(system_, this); audio_tab = std::make_unique(system_, tab_group, this); cpu_tab = std::make_unique(system_, tab_group, this); - general_tab = std::make_unique(system_, tab_group, *translations, this); graphics_advanced_tab = std::make_unique(system_, tab_group, *translations, this); graphics_tab = std::make_unique( @@ -65,7 +63,6 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st ui->setupUi(this); ui->tabWidget->addTab(addons_tab.get(), tr("Add-Ons")); - ui->tabWidget->addTab(general_tab.get(), tr("General")); ui->tabWidget->addTab(system_tab.get(), tr("System")); ui->tabWidget->addTab(cpu_tab.get(), tr("CPU")); ui->tabWidget->addTab(graphics_tab.get(), tr("Graphics")); -- cgit v1.2.3 From 8e151460265f04c7bf4a981b5f97f252a0444c27 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Wed, 10 May 2023 17:57:25 -0400 Subject: configure_system: Implement with for loop --- src/yuzu/configuration/configure_per_game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/configuration/configure_per_game.cpp') diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index 5548fc2ba..c39855334 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -58,7 +58,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, tab_group, *translations, this); input_tab = std::make_unique(system_, game_config.get(), this); - system_tab = std::make_unique(system_, tab_group, this); + system_tab = std::make_unique(system_, tab_group, *translations, this); ui->setupUi(this); -- cgit v1.2.3 From 432f68ad29df7a368ba375d75d667c954e9c80b9 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Thu, 18 May 2023 17:54:22 -0400 Subject: configure_audio: Implement ui generation Needs a considerable amount of management specific to some of the comoboboxes due to the audio engine configuration. general: Partial audio config implmentation configure_audio: Implement ui generation Needs a considerable amount of management specific to some of the comoboboxes due to the audio engine configuration. general: Partial audio config implmentation settings: Make audio settings as enums --- src/yuzu/configuration/configure_per_game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/configuration/configure_per_game.cpp') diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index c39855334..2ee0a8ffa 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -50,7 +50,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st game_config = std::make_unique(config_file_name, Config::ConfigType::PerGameConfig); addons_tab = std::make_unique(system_, this); - audio_tab = std::make_unique(system_, tab_group, this); + audio_tab = std::make_unique(system_, tab_group, *translations, this); cpu_tab = std::make_unique(system_, tab_group, this); graphics_advanced_tab = std::make_unique(system_, tab_group, *translations, this); -- cgit v1.2.3 From c5a3642cb62b4676d0c8b98949daec20e7c02e6b Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Thu, 18 May 2023 22:17:36 -0400 Subject: configuration: Use a mapping of setting value to name Makes comboboxes always correspond to the value of the setting they're modifying. --- src/yuzu/configuration/configure_per_game.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/yuzu/configuration/configure_per_game.cpp') diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index 2ee0a8ffa..845ffeeb8 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -43,6 +43,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st : QDialog(parent), ui(std::make_unique()), title_id{title_id_}, system{system_}, translations{ConfigurationShared::InitializeTranslations(this)}, + combobox_translations{ConfigurationShared::ComboboxEnumeration(this)}, tab_group{std::make_shared>()} { const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name)); const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()) @@ -50,15 +51,17 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st game_config = std::make_unique(config_file_name, Config::ConfigType::PerGameConfig); addons_tab = std::make_unique(system_, this); - audio_tab = std::make_unique(system_, tab_group, *translations, this); + audio_tab = std::make_unique(system_, tab_group, *translations, + *combobox_translations, this); cpu_tab = std::make_unique(system_, tab_group, this); - graphics_advanced_tab = - std::make_unique(system_, tab_group, *translations, this); + graphics_advanced_tab = std::make_unique( + system_, tab_group, *translations, *combobox_translations, this); graphics_tab = std::make_unique( system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, - tab_group, *translations, this); + tab_group, *translations, *combobox_translations, this); input_tab = std::make_unique(system_, game_config.get(), this); - system_tab = std::make_unique(system_, tab_group, *translations, this); + system_tab = std::make_unique(system_, tab_group, *translations, + *combobox_translations, this); ui->setupUi(this); -- cgit v1.2.3 From daa31121ee75dedcb636011e02815b816a7cc446 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Thu, 18 May 2023 22:54:58 -0400 Subject: configure_cpu: Generate UI --- src/yuzu/configuration/configure_per_game.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/yuzu/configuration/configure_per_game.cpp') diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index 845ffeeb8..5863beca0 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -53,7 +53,8 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st addons_tab = std::make_unique(system_, this); audio_tab = std::make_unique(system_, tab_group, *translations, *combobox_translations, this); - cpu_tab = std::make_unique(system_, tab_group, this); + cpu_tab = std::make_unique(system_, tab_group, *translations, + *combobox_translations, this); graphics_advanced_tab = std::make_unique( system_, tab_group, *translations, *combobox_translations, this); graphics_tab = std::make_unique( -- cgit v1.2.3 From ad645c29a44bd117cad90bda56e1f4d6296f2666 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Wed, 21 Jun 2023 01:42:42 -0400 Subject: configuration: Use a builder to create widgets This gets rid of some repeated code and sets us up to send more information to the new widget. --- src/yuzu/configuration/configure_per_game.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'src/yuzu/configuration/configure_per_game.cpp') diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index 5863beca0..cee8e726d 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -17,6 +17,7 @@ #include #include "common/fs/fs_util.h" +#include "configuration/shared_widget.h" #include "core/core.h" #include "core/file_sys/control_metadata.h" #include "core/file_sys/patch_manager.h" @@ -42,8 +43,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st Core::System& system_) : QDialog(parent), ui(std::make_unique()), title_id{title_id_}, system{system_}, - translations{ConfigurationShared::InitializeTranslations(this)}, - combobox_translations{ConfigurationShared::ComboboxEnumeration(this)}, + builder{std::make_unique(this, !system_.IsPoweredOn())}, tab_group{std::make_shared>()} { const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name)); const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()) @@ -51,18 +51,15 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st game_config = std::make_unique(config_file_name, Config::ConfigType::PerGameConfig); addons_tab = std::make_unique(system_, this); - audio_tab = std::make_unique(system_, tab_group, *translations, - *combobox_translations, this); - cpu_tab = std::make_unique(system_, tab_group, *translations, - *combobox_translations, this); - graphics_advanced_tab = std::make_unique( - system_, tab_group, *translations, *combobox_translations, this); + audio_tab = std::make_unique(system_, tab_group, *builder, this); + cpu_tab = std::make_unique(system_, tab_group, *builder, this); + graphics_advanced_tab = + std::make_unique(system_, tab_group, *builder, this); graphics_tab = std::make_unique( system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, - tab_group, *translations, *combobox_translations, this); + tab_group, *builder, this); input_tab = std::make_unique(system_, game_config.get(), this); - system_tab = std::make_unique(system_, tab_group, *translations, - *combobox_translations, this); + system_tab = std::make_unique(system_, tab_group, *builder, this); ui->setupUi(this); -- cgit v1.2.3 From 17b9c1e1715a16bebcdd92c02ce7f7e503212462 Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Fri, 21 Jul 2023 23:09:09 -0400 Subject: common,qt-config: Remove usage of forward_list --- src/yuzu/configuration/configure_per_game.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/yuzu/configuration/configure_per_game.cpp') diff --git a/src/yuzu/configuration/configure_per_game.cpp b/src/yuzu/configuration/configure_per_game.cpp index cee8e726d..cd8b3012e 100644 --- a/src/yuzu/configuration/configure_per_game.cpp +++ b/src/yuzu/configuration/configure_per_game.cpp @@ -44,7 +44,7 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st : QDialog(parent), ui(std::make_unique()), title_id{title_id_}, system{system_}, builder{std::make_unique(this, !system_.IsPoweredOn())}, - tab_group{std::make_shared>()} { + tab_group{std::make_shared>()} { const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name)); const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()) : fmt::format("{:016X}", title_id); -- cgit v1.2.3