From 464aad52cd644bdc32ca4eb35b0ce669c3b30c4f Mon Sep 17 00:00:00 2001 From: lat9nq <22451773+lat9nq@users.noreply.github.com> Date: Tue, 9 May 2023 01:35:25 -0400 Subject: [PATCH] settings: Add UiGeneral class --- src/common/settings.cpp | 4 ++++ src/common/settings.h | 7 +++++-- src/yuzu/configuration/config.cpp | 1 + src/yuzu/uisettings.h | 11 ++++++----- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 38a82f6f7..b7a0c063f 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -144,6 +144,9 @@ float Volume() { return values.volume.GetValue() / static_cast(values.volume.GetDefault()); } +Linkage::Linkage() = default; +Linkage::~Linkage() = default; + const char* TranslateCategory(Category category) { switch (category) { case Category::Audio: @@ -176,6 +179,7 @@ const char* TranslateCategory(Category category) { case Category::Controls: return "Controls"; case Category::Ui: + case Category::UiGeneral: return "UI"; case Category::UiLayout: return "UiLayout"; diff --git a/src/common/settings.h b/src/common/settings.h index 4ca8299b3..e60105059 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -143,6 +143,7 @@ enum class Category : u32 { AddOns, Controls, Ui, + UiGeneral, UiLayout, UiGameList, Screenshots, @@ -209,8 +210,10 @@ public: class Linkage { public: - std::map> by_category; - std::vector> restore_functions; + explicit Linkage(); + ~Linkage(); + std::map> by_category{}; + std::vector> restore_functions{}; u32 count; }; diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 28c606f5e..3181a9528 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp @@ -717,6 +717,7 @@ void Config::ReadUIValues() { ReadMultiplayerValues(); ReadCategory(Settings::Category::Ui); + ReadCategory(Settings::Category::UiGeneral); qt_config->endGroup(); } diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h index 53cdd7fcb..9e2cea4d6 100644 --- a/src/yuzu/uisettings.h +++ b/src/yuzu/uisettings.h @@ -78,17 +78,18 @@ struct Values { Setting show_filter_bar{linkage, true, "showFilterBar", Category::Ui}; Setting show_status_bar{linkage, true, "showStatusBar", Category::Ui}; - Setting confirm_before_closing{linkage, true, "confirmClose", Category::Ui}; + Setting confirm_before_closing{linkage, true, "confirmClose", Category::UiGeneral}; Setting first_start{linkage, true, "firstStart", Category::Ui}; - Setting pause_when_in_background{linkage, false, "pauseWhenInBackground", Category::Ui}; + Setting pause_when_in_background{linkage, false, "pauseWhenInBackground", + Category::UiGeneral}; Setting mute_when_in_background{linkage, false, "muteWhenInBackground", Category::Ui}; - Setting hide_mouse{linkage, true, "hideInactiveMouse", Category::Ui}; + Setting hide_mouse{linkage, true, "hideInactiveMouse", Category::UiGeneral}; Setting controller_applet_disabled{linkage, false, "disableControllerApplet", - Category::Ui}; + Category::UiGeneral}; // Set when Vulkan is known to crash the application bool has_broken_vulkan = false; - Setting select_user_on_boot{linkage, false, "select_user_on_boot", Category::Ui}; + Setting select_user_on_boot{linkage, false, "select_user_on_boot", Category::UiGeneral}; Setting disable_web_applet{linkage, true, "disable_web_applet", Category::Ui}; // Discord RPC