diff options
18 files changed, 110 insertions, 101 deletions
diff --git a/src/yuzu/configuration/configuration_shared.cpp b/src/yuzu/configuration/configuration_shared.cpp index ce12f55a2..72b7957e0 100644 --- a/src/yuzu/configuration/configuration_shared.cpp +++ b/src/yuzu/configuration/configuration_shared.cpp | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2016 Citra Emulator Project | 1 | // SPDX-FileCopyrightText: 2016 Citra Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <memory> | ||
| 4 | #include <QCheckBox> | 5 | #include <QCheckBox> |
| 5 | #include <QObject> | 6 | #include <QObject> |
| 6 | #include <QString> | 7 | #include <QString> |
| @@ -11,9 +12,14 @@ | |||
| 11 | 12 | ||
| 12 | namespace ConfigurationShared { | 13 | namespace ConfigurationShared { |
| 13 | 14 | ||
| 14 | Tab::Tab(QWidget* parent) : QWidget(parent) {} | 15 | Tab::Tab(std::shared_ptr<std::forward_list<Tab*>> group_, QWidget* parent) |
| 16 | : QWidget(parent), group{group_} { | ||
| 17 | if (group != nullptr) { | ||
| 18 | group->push_front(this); | ||
| 19 | } | ||
| 20 | } | ||
| 15 | 21 | ||
| 16 | Tab::~Tab() {} | 22 | Tab::~Tab() = default; |
| 17 | 23 | ||
| 18 | } // namespace ConfigurationShared | 24 | } // namespace ConfigurationShared |
| 19 | 25 | ||
diff --git a/src/yuzu/configuration/configuration_shared.h b/src/yuzu/configuration/configuration_shared.h index ea8b18755..1a3a2a985 100644 --- a/src/yuzu/configuration/configuration_shared.h +++ b/src/yuzu/configuration/configuration_shared.h | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <forward_list> | ||
| 7 | #include <iterator> | ||
| 8 | #include <memory> | ||
| 6 | #include <QCheckBox> | 9 | #include <QCheckBox> |
| 7 | #include <QComboBox> | 10 | #include <QComboBox> |
| 8 | #include <QWidget> | 11 | #include <QWidget> |
| @@ -15,11 +18,14 @@ class Tab : public QWidget { | |||
| 15 | Q_OBJECT | 18 | Q_OBJECT |
| 16 | 19 | ||
| 17 | public: | 20 | public: |
| 18 | explicit Tab(QWidget* parent = nullptr); | 21 | explicit Tab(std::shared_ptr<std::forward_list<Tab*>> group_, QWidget* parent = nullptr); |
| 19 | ~Tab(); | 22 | ~Tab(); |
| 20 | 23 | ||
| 21 | virtual void ApplyConfiguration() = 0; | 24 | virtual void ApplyConfiguration() = 0; |
| 22 | virtual void SetConfiguration() = 0; | 25 | virtual void SetConfiguration() = 0; |
| 26 | |||
| 27 | private: | ||
| 28 | std::shared_ptr<std::forward_list<Tab*>> group; | ||
| 23 | }; | 29 | }; |
| 24 | 30 | ||
| 25 | constexpr int USE_GLOBAL_INDEX = 0; | 31 | constexpr int USE_GLOBAL_INDEX = 0; |
diff --git a/src/yuzu/configuration/configure_audio.cpp b/src/yuzu/configuration/configure_audio.cpp index fcd6d61a0..335662144 100644 --- a/src/yuzu/configuration/configure_audio.cpp +++ b/src/yuzu/configuration/configure_audio.cpp | |||
| @@ -12,8 +12,10 @@ | |||
| 12 | #include "yuzu/configuration/configure_audio.h" | 12 | #include "yuzu/configuration/configure_audio.h" |
| 13 | #include "yuzu/uisettings.h" | 13 | #include "yuzu/uisettings.h" |
| 14 | 14 | ||
| 15 | ConfigureAudio::ConfigureAudio(const Core::System& system_, QWidget* parent) | 15 | ConfigureAudio::ConfigureAudio(const Core::System& system_, |
| 16 | : QWidget(parent), ui(std::make_unique<Ui::ConfigureAudio>()), system{system_} { | 16 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, |
| 17 | QWidget* parent) | ||
| 18 | : Tab(group, parent), ui(std::make_unique<Ui::ConfigureAudio>()), system{system_} { | ||
| 17 | ui->setupUi(this); | 19 | ui->setupUi(this); |
| 18 | 20 | ||
| 19 | InitializeAudioSinkComboBox(); | 21 | InitializeAudioSinkComboBox(); |
diff --git a/src/yuzu/configuration/configure_audio.h b/src/yuzu/configuration/configure_audio.h index 0d03aae1d..d134ac957 100644 --- a/src/yuzu/configuration/configure_audio.h +++ b/src/yuzu/configuration/configure_audio.h | |||
| @@ -5,28 +5,25 @@ | |||
| 5 | 5 | ||
| 6 | #include <memory> | 6 | #include <memory> |
| 7 | #include <QWidget> | 7 | #include <QWidget> |
| 8 | #include "yuzu/configuration/configuration_shared.h" | ||
| 8 | 9 | ||
| 9 | namespace Core { | 10 | namespace Core { |
| 10 | class System; | 11 | class System; |
| 11 | } | 12 | } |
| 12 | 13 | ||
| 13 | namespace ConfigurationShared { | ||
| 14 | enum class CheckState; | ||
| 15 | } | ||
| 16 | |||
| 17 | namespace Ui { | 14 | namespace Ui { |
| 18 | class ConfigureAudio; | 15 | class ConfigureAudio; |
| 19 | } | 16 | } |
| 20 | 17 | ||
| 21 | class ConfigureAudio : public QWidget { | 18 | class ConfigureAudio : public ConfigurationShared::Tab { |
| 22 | Q_OBJECT | ||
| 23 | |||
| 24 | public: | 19 | public: |
| 25 | explicit ConfigureAudio(const Core::System& system_, QWidget* parent = nullptr); | 20 | explicit ConfigureAudio(const Core::System& system_, |
| 21 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, | ||
| 22 | QWidget* parent = nullptr); | ||
| 26 | ~ConfigureAudio() override; | 23 | ~ConfigureAudio() override; |
| 27 | 24 | ||
| 28 | void ApplyConfiguration(); | 25 | void ApplyConfiguration() override; |
| 29 | void SetConfiguration(); | 26 | void SetConfiguration() override; |
| 30 | 27 | ||
| 31 | private: | 28 | private: |
| 32 | void changeEvent(QEvent* event) override; | 29 | void changeEvent(QEvent* event) override; |
diff --git a/src/yuzu/configuration/configure_cpu.cpp b/src/yuzu/configuration/configure_cpu.cpp index 3d69fb03f..ecaeb1a6b 100644 --- a/src/yuzu/configuration/configure_cpu.cpp +++ b/src/yuzu/configuration/configure_cpu.cpp | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | 3 | ||
| 4 | #include <forward_list> | ||
| 5 | #include <memory> | ||
| 4 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
| 5 | #include "common/settings.h" | 7 | #include "common/settings.h" |
| 6 | #include "core/core.h" | 8 | #include "core/core.h" |
| @@ -8,8 +10,10 @@ | |||
| 8 | #include "yuzu/configuration/configuration_shared.h" | 10 | #include "yuzu/configuration/configuration_shared.h" |
| 9 | #include "yuzu/configuration/configure_cpu.h" | 11 | #include "yuzu/configuration/configure_cpu.h" |
| 10 | 12 | ||
| 11 | ConfigureCpu::ConfigureCpu(const Core::System& system_, QWidget* parent) | 13 | ConfigureCpu::ConfigureCpu(const Core::System& system_, |
| 12 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureCpu>()}, system{system_} { | 14 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, |
| 15 | QWidget* parent) | ||
| 16 | : Tab(group, parent), ui{std::make_unique<Ui::ConfigureCpu>()}, system{system_} { | ||
| 13 | ui->setupUi(this); | 17 | ui->setupUi(this); |
| 14 | 18 | ||
| 15 | SetupPerGameUI(); | 19 | SetupPerGameUI(); |
diff --git a/src/yuzu/configuration/configure_cpu.h b/src/yuzu/configuration/configure_cpu.h index 86d928ca3..187d080b6 100644 --- a/src/yuzu/configuration/configure_cpu.h +++ b/src/yuzu/configuration/configure_cpu.h | |||
| @@ -5,28 +5,25 @@ | |||
| 5 | 5 | ||
| 6 | #include <memory> | 6 | #include <memory> |
| 7 | #include <QWidget> | 7 | #include <QWidget> |
| 8 | #include "yuzu/configuration/configuration_shared.h" | ||
| 8 | 9 | ||
| 9 | namespace Core { | 10 | namespace Core { |
| 10 | class System; | 11 | class System; |
| 11 | } | 12 | } |
| 12 | 13 | ||
| 13 | namespace ConfigurationShared { | ||
| 14 | enum class CheckState; | ||
| 15 | } | ||
| 16 | |||
| 17 | namespace Ui { | 14 | namespace Ui { |
| 18 | class ConfigureCpu; | 15 | class ConfigureCpu; |
| 19 | } | 16 | } |
| 20 | 17 | ||
| 21 | class ConfigureCpu : public QWidget { | 18 | class ConfigureCpu : public ConfigurationShared::Tab { |
| 22 | Q_OBJECT | ||
| 23 | |||
| 24 | public: | 19 | public: |
| 25 | explicit ConfigureCpu(const Core::System& system_, QWidget* parent = nullptr); | 20 | explicit ConfigureCpu(const Core::System& system_, |
| 21 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, | ||
| 22 | QWidget* parent = nullptr); | ||
| 26 | ~ConfigureCpu() override; | 23 | ~ConfigureCpu() override; |
| 27 | 24 | ||
| 28 | void ApplyConfiguration(); | 25 | void ApplyConfiguration() override; |
| 29 | void SetConfiguration(); | 26 | void SetConfiguration() override; |
| 30 | 27 | ||
| 31 | private: | 28 | private: |
| 32 | void changeEvent(QEvent* event) override; | 29 | void changeEvent(QEvent* event) override; |
diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index bdf83ebfe..2cc9f3621 100644 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp | |||
| @@ -32,21 +32,21 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, | |||
| 32 | std::vector<VkDeviceInfo::Record>& vk_device_records, | 32 | std::vector<VkDeviceInfo::Record>& vk_device_records, |
| 33 | Core::System& system_, bool enable_web_config) | 33 | Core::System& system_, bool enable_web_config) |
| 34 | : QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, | 34 | : QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, |
| 35 | registry(registry_), system{system_}, audio_tab{std::make_unique<ConfigureAudio>(system_, | 35 | registry(registry_), system{system_}, audio_tab{std::make_unique<ConfigureAudio>( |
| 36 | this)}, | 36 | system_, nullptr, this)}, |
| 37 | cpu_tab{std::make_unique<ConfigureCpu>(system_, this)}, | 37 | cpu_tab{std::make_unique<ConfigureCpu>(system_, nullptr, this)}, |
| 38 | debug_tab_tab{std::make_unique<ConfigureDebugTab>(system_, this)}, | 38 | debug_tab_tab{std::make_unique<ConfigureDebugTab>(system_, this)}, |
| 39 | filesystem_tab{std::make_unique<ConfigureFilesystem>(this)}, | 39 | filesystem_tab{std::make_unique<ConfigureFilesystem>(this)}, |
| 40 | general_tab{std::make_unique<ConfigureGeneral>(system_, this)}, | 40 | general_tab{std::make_unique<ConfigureGeneral>(system_, nullptr, this)}, |
| 41 | graphics_advanced_tab{std::make_unique<ConfigureGraphicsAdvanced>(system_, this)}, | 41 | graphics_advanced_tab{std::make_unique<ConfigureGraphicsAdvanced>(system_, nullptr, this)}, |
| 42 | graphics_tab{std::make_unique<ConfigureGraphics>( | 42 | graphics_tab{std::make_unique<ConfigureGraphics>( |
| 43 | system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, | 43 | system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, |
| 44 | this)}, | 44 | nullptr, this)}, |
| 45 | hotkeys_tab{std::make_unique<ConfigureHotkeys>(system_.HIDCore(), this)}, | 45 | hotkeys_tab{std::make_unique<ConfigureHotkeys>(system_.HIDCore(), this)}, |
| 46 | input_tab{std::make_unique<ConfigureInput>(system_, this)}, | 46 | input_tab{std::make_unique<ConfigureInput>(system_, this)}, |
| 47 | network_tab{std::make_unique<ConfigureNetwork>(system_, this)}, | 47 | network_tab{std::make_unique<ConfigureNetwork>(system_, this)}, |
| 48 | profile_tab{std::make_unique<ConfigureProfileManager>(system_, this)}, | 48 | profile_tab{std::make_unique<ConfigureProfileManager>(system_, this)}, |
| 49 | system_tab{std::make_unique<ConfigureSystem>(system_, this)}, | 49 | system_tab{std::make_unique<ConfigureSystem>(system_, nullptr, this)}, |
| 50 | ui_tab{std::make_unique<ConfigureUi>(system_, this)}, web_tab{std::make_unique<ConfigureWeb>( | 50 | ui_tab{std::make_unique<ConfigureUi>(system_, this)}, web_tab{std::make_unique<ConfigureWeb>( |
| 51 | this)} { | 51 | this)} { |
| 52 | Settings::SetConfiguringGlobal(true); | 52 | Settings::SetConfiguringGlobal(true); |
diff --git a/src/yuzu/configuration/configure_dialog.h b/src/yuzu/configuration/configure_dialog.h index 2a08b7fee..8ee89a192 100644 --- a/src/yuzu/configuration/configure_dialog.h +++ b/src/yuzu/configuration/configure_dialog.h | |||
| @@ -3,9 +3,11 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <forward_list> | ||
| 6 | #include <memory> | 7 | #include <memory> |
| 7 | #include <vector> | 8 | #include <vector> |
| 8 | #include <QDialog> | 9 | #include <QDialog> |
| 10 | #include "configuration/configuration_shared.h" | ||
| 9 | #include "yuzu/vk_device_info.h" | 11 | #include "yuzu/vk_device_info.h" |
| 10 | 12 | ||
| 11 | namespace Core { | 13 | namespace Core { |
| @@ -69,6 +71,7 @@ private: | |||
| 69 | HotkeyRegistry& registry; | 71 | HotkeyRegistry& registry; |
| 70 | 72 | ||
| 71 | Core::System& system; | 73 | Core::System& system; |
| 74 | std::forward_list<ConfigurationShared::Tab*> tab_group; | ||
| 72 | 75 | ||
| 73 | std::unique_ptr<ConfigureAudio> audio_tab; | 76 | std::unique_ptr<ConfigureAudio> audio_tab; |
| 74 | std::unique_ptr<ConfigureCpu> cpu_tab; | 77 | std::unique_ptr<ConfigureCpu> cpu_tab; |
diff --git a/src/yuzu/configuration/configure_general.cpp b/src/yuzu/configuration/configure_general.cpp index 2f55159f5..03261992a 100644 --- a/src/yuzu/configuration/configure_general.cpp +++ b/src/yuzu/configuration/configure_general.cpp | |||
| @@ -11,8 +11,10 @@ | |||
| 11 | #include "yuzu/configuration/configure_general.h" | 11 | #include "yuzu/configuration/configure_general.h" |
| 12 | #include "yuzu/uisettings.h" | 12 | #include "yuzu/uisettings.h" |
| 13 | 13 | ||
| 14 | ConfigureGeneral::ConfigureGeneral(const Core::System& system_, QWidget* parent) | 14 | ConfigureGeneral::ConfigureGeneral( |
| 15 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureGeneral>()}, system{system_} { | 15 | const Core::System& system_, |
| 16 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, QWidget* parent) | ||
| 17 | : Tab(group, parent), ui{std::make_unique<Ui::ConfigureGeneral>()}, system{system_} { | ||
| 16 | ui->setupUi(this); | 18 | ui->setupUi(this); |
| 17 | 19 | ||
| 18 | SetupPerGameUI(); | 20 | SetupPerGameUI(); |
diff --git a/src/yuzu/configuration/configure_general.h b/src/yuzu/configuration/configure_general.h index 7ff63f425..0aad69f0a 100644 --- a/src/yuzu/configuration/configure_general.h +++ b/src/yuzu/configuration/configure_general.h | |||
| @@ -6,34 +6,30 @@ | |||
| 6 | #include <functional> | 6 | #include <functional> |
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | #include <QWidget> | 8 | #include <QWidget> |
| 9 | #include "yuzu/configuration/configuration_shared.h" | ||
| 9 | 10 | ||
| 10 | namespace Core { | 11 | namespace Core { |
| 11 | class System; | 12 | class System; |
| 12 | } | 13 | } |
| 13 | 14 | ||
| 14 | class ConfigureDialog; | 15 | class ConfigureDialog; |
| 15 | |||
| 16 | namespace ConfigurationShared { | ||
| 17 | enum class CheckState; | ||
| 18 | } | ||
| 19 | |||
| 20 | class HotkeyRegistry; | 16 | class HotkeyRegistry; |
| 21 | 17 | ||
| 22 | namespace Ui { | 18 | namespace Ui { |
| 23 | class ConfigureGeneral; | 19 | class ConfigureGeneral; |
| 24 | } | 20 | } |
| 25 | 21 | ||
| 26 | class ConfigureGeneral : public QWidget { | 22 | class ConfigureGeneral : public ConfigurationShared::Tab { |
| 27 | Q_OBJECT | ||
| 28 | |||
| 29 | public: | 23 | public: |
| 30 | explicit ConfigureGeneral(const Core::System& system_, QWidget* parent = nullptr); | 24 | explicit ConfigureGeneral(const Core::System& system_, |
| 25 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, | ||
| 26 | QWidget* parent = nullptr); | ||
| 31 | ~ConfigureGeneral() override; | 27 | ~ConfigureGeneral() override; |
| 32 | 28 | ||
| 33 | void SetResetCallback(std::function<void()> callback); | 29 | void SetResetCallback(std::function<void()> callback); |
| 34 | void ResetDefaults(); | 30 | void ResetDefaults(); |
| 35 | void ApplyConfiguration(); | 31 | void ApplyConfiguration() override; |
| 36 | void SetConfiguration(); | 32 | void SetConfiguration() override; |
| 37 | 33 | ||
| 38 | private: | 34 | private: |
| 39 | void changeEvent(QEvent* event) override; | 35 | void changeEvent(QEvent* event) override; |
diff --git a/src/yuzu/configuration/configure_graphics.cpp b/src/yuzu/configuration/configure_graphics.cpp index e70781357..a8c5b1d9f 100644 --- a/src/yuzu/configuration/configure_graphics.cpp +++ b/src/yuzu/configuration/configure_graphics.cpp | |||
| @@ -70,12 +70,12 @@ static constexpr Settings::VSyncMode PresentModeToSetting(VkPresentModeKHR mode) | |||
| 70 | } | 70 | } |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | ConfigureGraphics::ConfigureGraphics(const Core::System& system_, | 73 | ConfigureGraphics::ConfigureGraphics( |
| 74 | std::vector<VkDeviceInfo::Record>& records_, | 74 | const Core::System& system_, std::vector<VkDeviceInfo::Record>& records_, |
| 75 | const std::function<void()>& expose_compute_option_, | 75 | const std::function<void()>& expose_compute_option_, |
| 76 | QWidget* parent) | 76 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, QWidget* parent) |
| 77 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureGraphics>()}, records{records_}, | 77 | : ConfigurationShared::Tab(group, parent), ui{std::make_unique<Ui::ConfigureGraphics>()}, |
| 78 | expose_compute_option{expose_compute_option_}, system{system_} { | 78 | records{records_}, expose_compute_option{expose_compute_option_}, system{system_} { |
| 79 | vulkan_device = Settings::values.vulkan_device.GetValue(); | 79 | vulkan_device = Settings::values.vulkan_device.GetValue(); |
| 80 | RetrieveVulkanDevices(); | 80 | RetrieveVulkanDevices(); |
| 81 | 81 | ||
diff --git a/src/yuzu/configuration/configure_graphics.h b/src/yuzu/configuration/configure_graphics.h index be9310b74..adc3faffa 100644 --- a/src/yuzu/configuration/configure_graphics.h +++ b/src/yuzu/configuration/configure_graphics.h | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <vulkan/vulkan_core.h> | 13 | #include <vulkan/vulkan_core.h> |
| 14 | #include "common/common_types.h" | 14 | #include "common/common_types.h" |
| 15 | #include "vk_device_info.h" | 15 | #include "vk_device_info.h" |
| 16 | #include "yuzu/configuration/configuration_shared.h" | ||
| 16 | 17 | ||
| 17 | class QEvent; | 18 | class QEvent; |
| 18 | class QObject; | 19 | class QObject; |
| @@ -27,26 +28,21 @@ namespace Core { | |||
| 27 | class System; | 28 | class System; |
| 28 | } | 29 | } |
| 29 | 30 | ||
| 30 | namespace ConfigurationShared { | ||
| 31 | enum class CheckState; | ||
| 32 | } | ||
| 33 | |||
| 34 | namespace Ui { | 31 | namespace Ui { |
| 35 | class ConfigureGraphics; | 32 | class ConfigureGraphics; |
| 36 | } | 33 | } |
| 37 | 34 | ||
| 38 | class ConfigureGraphics : public QWidget { | 35 | class ConfigureGraphics : public ConfigurationShared::Tab { |
| 39 | Q_OBJECT | ||
| 40 | |||
| 41 | public: | 36 | public: |
| 42 | explicit ConfigureGraphics(const Core::System& system_, | 37 | explicit ConfigureGraphics(const Core::System& system_, |
| 43 | std::vector<VkDeviceInfo::Record>& records, | 38 | std::vector<VkDeviceInfo::Record>& records, |
| 44 | const std::function<void()>& expose_compute_option_, | 39 | const std::function<void()>& expose_compute_option_, |
| 40 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, | ||
| 45 | QWidget* parent = nullptr); | 41 | QWidget* parent = nullptr); |
| 46 | ~ConfigureGraphics() override; | 42 | ~ConfigureGraphics() override; |
| 47 | 43 | ||
| 48 | void ApplyConfiguration(); | 44 | void ApplyConfiguration() override; |
| 49 | void SetConfiguration(); | 45 | void SetConfiguration() override; |
| 50 | 46 | ||
| 51 | private: | 47 | private: |
| 52 | void changeEvent(QEvent* event) override; | 48 | void changeEvent(QEvent* event) override; |
diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index e5c99f742..d332c9b7b 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp | |||
| @@ -7,8 +7,10 @@ | |||
| 7 | #include "yuzu/configuration/configuration_shared.h" | 7 | #include "yuzu/configuration/configuration_shared.h" |
| 8 | #include "yuzu/configuration/configure_graphics_advanced.h" | 8 | #include "yuzu/configuration/configure_graphics_advanced.h" |
| 9 | 9 | ||
| 10 | ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced(const Core::System& system_, QWidget* parent) | 10 | ConfigureGraphicsAdvanced::ConfigureGraphicsAdvanced( |
| 11 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureGraphicsAdvanced>()}, system{system_} { | 11 | const Core::System& system_, |
| 12 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, QWidget* parent) | ||
| 13 | : Tab(group, parent), ui{std::make_unique<Ui::ConfigureGraphicsAdvanced>()}, system{system_} { | ||
| 12 | 14 | ||
| 13 | ui->setupUi(this); | 15 | ui->setupUi(this); |
| 14 | 16 | ||
diff --git a/src/yuzu/configuration/configure_graphics_advanced.h b/src/yuzu/configuration/configure_graphics_advanced.h index 369a7c83e..585b9cb50 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.h +++ b/src/yuzu/configuration/configure_graphics_advanced.h | |||
| @@ -5,28 +5,26 @@ | |||
| 5 | 5 | ||
| 6 | #include <memory> | 6 | #include <memory> |
| 7 | #include <QWidget> | 7 | #include <QWidget> |
| 8 | #include "yuzu/configuration/configuration_shared.h" | ||
| 8 | 9 | ||
| 9 | namespace Core { | 10 | namespace Core { |
| 10 | class System; | 11 | class System; |
| 11 | } | 12 | } |
| 12 | 13 | ||
| 13 | namespace ConfigurationShared { | ||
| 14 | enum class CheckState; | ||
| 15 | } | ||
| 16 | |||
| 17 | namespace Ui { | 14 | namespace Ui { |
| 18 | class ConfigureGraphicsAdvanced; | 15 | class ConfigureGraphicsAdvanced; |
| 19 | } | 16 | } |
| 20 | 17 | ||
| 21 | class ConfigureGraphicsAdvanced : public QWidget { | 18 | class ConfigureGraphicsAdvanced : public ConfigurationShared::Tab { |
| 22 | Q_OBJECT | ||
| 23 | |||
| 24 | public: | 19 | public: |
| 25 | explicit ConfigureGraphicsAdvanced(const Core::System& system_, QWidget* parent = nullptr); | 20 | explicit ConfigureGraphicsAdvanced( |
| 21 | const Core::System& system_, | ||
| 22 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, | ||
| 23 | QWidget* parent = nullptr); | ||
| 26 | ~ConfigureGraphicsAdvanced() override; | 24 | ~ConfigureGraphicsAdvanced() override; |
| 27 | 25 | ||
| 28 | void ApplyConfiguration(); | 26 | void ApplyConfiguration() override; |
| 29 | void SetConfiguration(); | 27 | void SetConfiguration() override; |
| 30 | 28 | ||
| 31 | void ExposeComputeOption(); | 29 | void ExposeComputeOption(); |
| 32 | 30 | ||
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 @@ | |||
| 24 | #include "core/loader/loader.h" | 24 | #include "core/loader/loader.h" |
| 25 | #include "ui_configure_per_game.h" | 25 | #include "ui_configure_per_game.h" |
| 26 | #include "yuzu/configuration/config.h" | 26 | #include "yuzu/configuration/config.h" |
| 27 | #include "yuzu/configuration/configuration_shared.h" | ||
| 27 | #include "yuzu/configuration/configure_audio.h" | 28 | #include "yuzu/configuration/configure_audio.h" |
| 28 | #include "yuzu/configuration/configure_cpu.h" | 29 | #include "yuzu/configuration/configure_cpu.h" |
| 29 | #include "yuzu/configuration/configure_general.h" | 30 | #include "yuzu/configuration/configure_general.h" |
| @@ -40,22 +41,23 @@ | |||
| 40 | ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name, | 41 | ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name, |
| 41 | std::vector<VkDeviceInfo::Record>& vk_device_records, | 42 | std::vector<VkDeviceInfo::Record>& vk_device_records, |
| 42 | Core::System& system_) | 43 | Core::System& system_) |
| 43 | : QDialog(parent), | 44 | : QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_}, |
| 44 | ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_}, system{system_} { | 45 | system{system_}, group{std::make_shared<std::forward_list<ConfigurationShared::Tab*>>()} { |
| 45 | const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name)); | 46 | const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name)); |
| 46 | const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()) | 47 | const auto config_file_name = title_id == 0 ? Common::FS::PathToUTF8String(file_path.filename()) |
| 47 | : fmt::format("{:016X}", title_id); | 48 | : fmt::format("{:016X}", title_id); |
| 48 | game_config = std::make_unique<Config>(config_file_name, Config::ConfigType::PerGameConfig); | 49 | game_config = std::make_unique<Config>(config_file_name, Config::ConfigType::PerGameConfig); |
| 49 | 50 | ||
| 50 | addons_tab = std::make_unique<ConfigurePerGameAddons>(system_, this); | 51 | addons_tab = std::make_unique<ConfigurePerGameAddons>(system_, this); |
| 51 | audio_tab = std::make_unique<ConfigureAudio>(system_, this); | 52 | audio_tab = std::make_unique<ConfigureAudio>(system_, group, this); |
| 52 | cpu_tab = std::make_unique<ConfigureCpu>(system_, this); | 53 | cpu_tab = std::make_unique<ConfigureCpu>(system_, group, this); |
| 53 | general_tab = std::make_unique<ConfigureGeneral>(system_, this); | 54 | general_tab = std::make_unique<ConfigureGeneral>(system_, group, this); |
| 54 | graphics_advanced_tab = std::make_unique<ConfigureGraphicsAdvanced>(system_, this); | 55 | graphics_advanced_tab = std::make_unique<ConfigureGraphicsAdvanced>(system_, group, this); |
| 55 | graphics_tab = std::make_unique<ConfigureGraphics>( | 56 | graphics_tab = std::make_unique<ConfigureGraphics>( |
| 56 | system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, this); | 57 | system_, vk_device_records, [&]() { graphics_advanced_tab->ExposeComputeOption(); }, group, |
| 58 | this); | ||
| 57 | input_tab = std::make_unique<ConfigureInputPerGame>(system_, game_config.get(), this); | 59 | input_tab = std::make_unique<ConfigureInputPerGame>(system_, game_config.get(), this); |
| 58 | system_tab = std::make_unique<ConfigureSystem>(system_, this); | 60 | system_tab = std::make_unique<ConfigureSystem>(system_, group, this); |
| 59 | 61 | ||
| 60 | ui->setupUi(this); | 62 | ui->setupUi(this); |
| 61 | 63 | ||
| @@ -88,13 +90,10 @@ ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::st | |||
| 88 | ConfigurePerGame::~ConfigurePerGame() = default; | 90 | ConfigurePerGame::~ConfigurePerGame() = default; |
| 89 | 91 | ||
| 90 | void ConfigurePerGame::ApplyConfiguration() { | 92 | void ConfigurePerGame::ApplyConfiguration() { |
| 93 | for (const auto tab : *group) { | ||
| 94 | tab->ApplyConfiguration(); | ||
| 95 | } | ||
| 91 | addons_tab->ApplyConfiguration(); | 96 | addons_tab->ApplyConfiguration(); |
| 92 | general_tab->ApplyConfiguration(); | ||
| 93 | cpu_tab->ApplyConfiguration(); | ||
| 94 | system_tab->ApplyConfiguration(); | ||
| 95 | graphics_tab->ApplyConfiguration(); | ||
| 96 | graphics_advanced_tab->ApplyConfiguration(); | ||
| 97 | audio_tab->ApplyConfiguration(); | ||
| 98 | input_tab->ApplyConfiguration(); | 97 | input_tab->ApplyConfiguration(); |
| 99 | 98 | ||
| 100 | system.ApplySettings(); | 99 | system.ApplySettings(); |
diff --git a/src/yuzu/configuration/configure_per_game.h b/src/yuzu/configuration/configure_per_game.h index 7ec1ded06..5326e70e6 100644 --- a/src/yuzu/configuration/configure_per_game.h +++ b/src/yuzu/configuration/configure_per_game.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <forward_list> | ||
| 6 | #include <memory> | 7 | #include <memory> |
| 7 | #include <string> | 8 | #include <string> |
| 8 | #include <vector> | 9 | #include <vector> |
| @@ -13,6 +14,7 @@ | |||
| 13 | #include "core/file_sys/vfs_types.h" | 14 | #include "core/file_sys/vfs_types.h" |
| 14 | #include "vk_device_info.h" | 15 | #include "vk_device_info.h" |
| 15 | #include "yuzu/configuration/config.h" | 16 | #include "yuzu/configuration/config.h" |
| 17 | #include "yuzu/configuration/configuration_shared.h" | ||
| 16 | 18 | ||
| 17 | namespace Core { | 19 | namespace Core { |
| 18 | class System; | 20 | class System; |
| @@ -73,7 +75,7 @@ private: | |||
| 73 | std::unique_ptr<Config> game_config; | 75 | std::unique_ptr<Config> game_config; |
| 74 | 76 | ||
| 75 | Core::System& system; | 77 | Core::System& system; |
| 76 | 78 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group; | |
| 77 | std::unique_ptr<ConfigurePerGameAddons> addons_tab; | 79 | std::unique_ptr<ConfigurePerGameAddons> addons_tab; |
| 78 | std::unique_ptr<ConfigureAudio> audio_tab; | 80 | std::unique_ptr<ConfigureAudio> audio_tab; |
| 79 | std::unique_ptr<ConfigureCpu> cpu_tab; | 81 | std::unique_ptr<ConfigureCpu> cpu_tab; |
diff --git a/src/yuzu/configuration/configure_system.cpp b/src/yuzu/configuration/configure_system.cpp index c892635b8..4872a475b 100644 --- a/src/yuzu/configuration/configure_system.cpp +++ b/src/yuzu/configuration/configure_system.cpp | |||
| @@ -37,8 +37,10 @@ static bool IsValidLocale(u32 region_index, u32 language_index) { | |||
| 37 | return ((LOCALE_BLOCKLIST.at(region_index) >> language_index) & 1) == 0; | 37 | return ((LOCALE_BLOCKLIST.at(region_index) >> language_index) & 1) == 0; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | ConfigureSystem::ConfigureSystem(Core::System& system_, QWidget* parent) | 40 | ConfigureSystem::ConfigureSystem( |
| 41 | : QWidget(parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_} { | 41 | Core::System& system_, std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, |
| 42 | QWidget* parent) | ||
| 43 | : Tab(group, parent), ui{std::make_unique<Ui::ConfigureSystem>()}, system{system_} { | ||
| 42 | ui->setupUi(this); | 44 | ui->setupUi(this); |
| 43 | 45 | ||
| 44 | connect(ui->rng_seed_checkbox, &QCheckBox::stateChanged, this, [this](int state) { | 46 | connect(ui->rng_seed_checkbox, &QCheckBox::stateChanged, this, [this](int state) { |
diff --git a/src/yuzu/configuration/configure_system.h b/src/yuzu/configuration/configure_system.h index ce1a91601..6064b5b40 100644 --- a/src/yuzu/configuration/configure_system.h +++ b/src/yuzu/configuration/configure_system.h | |||
| @@ -6,28 +6,25 @@ | |||
| 6 | #include <memory> | 6 | #include <memory> |
| 7 | 7 | ||
| 8 | #include <QWidget> | 8 | #include <QWidget> |
| 9 | #include "yuzu/configuration/configuration_shared.h" | ||
| 9 | 10 | ||
| 10 | namespace Core { | 11 | namespace Core { |
| 11 | class System; | 12 | class System; |
| 12 | } | 13 | } |
| 13 | 14 | ||
| 14 | namespace ConfigurationShared { | ||
| 15 | enum class CheckState; | ||
| 16 | } | ||
| 17 | |||
| 18 | namespace Ui { | 15 | namespace Ui { |
| 19 | class ConfigureSystem; | 16 | class ConfigureSystem; |
| 20 | } | 17 | } |
| 21 | 18 | ||
| 22 | class ConfigureSystem : public QWidget { | 19 | class ConfigureSystem : public ConfigurationShared::Tab { |
| 23 | Q_OBJECT | ||
| 24 | |||
| 25 | public: | 20 | public: |
| 26 | explicit ConfigureSystem(Core::System& system_, QWidget* parent = nullptr); | 21 | explicit ConfigureSystem(Core::System& system_, |
| 22 | std::shared_ptr<std::forward_list<ConfigurationShared::Tab*>> group, | ||
| 23 | QWidget* parent = nullptr); | ||
| 27 | ~ConfigureSystem() override; | 24 | ~ConfigureSystem() override; |
| 28 | 25 | ||
| 29 | void ApplyConfiguration(); | 26 | void ApplyConfiguration() override; |
| 30 | void SetConfiguration(); | 27 | void SetConfiguration() override; |
| 31 | 28 | ||
| 32 | private: | 29 | private: |
| 33 | void changeEvent(QEvent* event) override; | 30 | void changeEvent(QEvent* event) override; |