diff options
| author | 2024-01-26 23:28:24 -0500 | |
|---|---|---|
| committer | 2024-02-09 09:20:53 -0500 | |
| commit | fa123843506ee748bf4d220253bc52e58cf36fe6 (patch) | |
| tree | 6cdf6811f4175a34a288e4daad361fca83ac9032 /src | |
| parent | gpu: dependency-inject scaling/antialiasing filter state for capture layers (diff) | |
| download | yuzu-fa123843506ee748bf4d220253bc52e58cf36fe6.tar.gz yuzu-fa123843506ee748bf4d220253bc52e58cf36fe6.tar.xz yuzu-fa123843506ee748bf4d220253bc52e58cf36fe6.zip | |
general: add default configurations for applet mode
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/settings.cpp | 3 | ||||
| -rw-r--r-- | src/common/settings.h | 32 | ||||
| -rw-r--r-- | src/common/settings_common.h | 1 | ||||
| -rw-r--r-- | src/common/settings_enums.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/am/library_applet_creator.cpp | 51 | ||||
| -rw-r--r-- | src/frontend_common/config.cpp | 18 | ||||
| -rw-r--r-- | src/frontend_common/config.h | 2 | ||||
| -rw-r--r-- | src/yuzu/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_applets.cpp | 86 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_applets.h | 48 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_applets.ui | 65 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_dialog.cpp | 7 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_dialog.h | 2 | ||||
| -rw-r--r-- | src/yuzu/configuration/shared_translation.cpp | 22 |
14 files changed, 334 insertions, 8 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 07709d4e5..80d388fe8 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -30,6 +30,7 @@ namespace Settings { | |||
| 30 | #define SETTING(TYPE, RANGED) template class Setting<TYPE, RANGED> | 30 | #define SETTING(TYPE, RANGED) template class Setting<TYPE, RANGED> |
| 31 | #define SWITCHABLE(TYPE, RANGED) template class SwitchableSetting<TYPE, RANGED> | 31 | #define SWITCHABLE(TYPE, RANGED) template class SwitchableSetting<TYPE, RANGED> |
| 32 | 32 | ||
| 33 | SETTING(AppletMode, false); | ||
| 33 | SETTING(AudioEngine, false); | 34 | SETTING(AudioEngine, false); |
| 34 | SETTING(bool, false); | 35 | SETTING(bool, false); |
| 35 | SETTING(int, false); | 36 | SETTING(int, false); |
| @@ -215,6 +216,8 @@ const char* TranslateCategory(Category category) { | |||
| 215 | return "Debugging"; | 216 | return "Debugging"; |
| 216 | case Category::GpuDriver: | 217 | case Category::GpuDriver: |
| 217 | return "GpuDriver"; | 218 | return "GpuDriver"; |
| 219 | case Category::LibraryApplet: | ||
| 220 | return "LibraryApplet"; | ||
| 218 | case Category::Miscellaneous: | 221 | case Category::Miscellaneous: |
| 219 | return "Miscellaneous"; | 222 | return "Miscellaneous"; |
| 220 | case Category::Network: | 223 | case Category::Network: |
diff --git a/src/common/settings.h b/src/common/settings.h index f1b1add56..aa054dc24 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -133,6 +133,38 @@ struct TouchFromButtonMap { | |||
| 133 | struct Values { | 133 | struct Values { |
| 134 | Linkage linkage{}; | 134 | Linkage linkage{}; |
| 135 | 135 | ||
| 136 | // Applet | ||
| 137 | Setting<AppletMode> cabinet_applet_mode{linkage, AppletMode::LLE, "cabinet_applet_mode", | ||
| 138 | Category::LibraryApplet}; | ||
| 139 | Setting<AppletMode> controller_applet_mode{linkage, AppletMode::HLE, "controller_applet_mode", | ||
| 140 | Category::LibraryApplet}; | ||
| 141 | Setting<AppletMode> data_erase_applet_mode{linkage, AppletMode::HLE, "data_erase_applet_mode", | ||
| 142 | Category::LibraryApplet}; | ||
| 143 | Setting<AppletMode> error_applet_mode{linkage, AppletMode::HLE, "error_applet_mode", | ||
| 144 | Category::LibraryApplet}; | ||
| 145 | Setting<AppletMode> net_connect_applet_mode{linkage, AppletMode::HLE, "net_connect_applet_mode", | ||
| 146 | Category::LibraryApplet}; | ||
| 147 | Setting<AppletMode> player_select_applet_mode{ | ||
| 148 | linkage, AppletMode::HLE, "player_select_applet_mode", Category::LibraryApplet}; | ||
| 149 | Setting<AppletMode> swkbd_applet_mode{linkage, AppletMode::LLE, "swkbd_applet_mode", | ||
| 150 | Category::LibraryApplet}; | ||
| 151 | Setting<AppletMode> mii_edit_applet_mode{linkage, AppletMode::LLE, "mii_edit_applet_mode", | ||
| 152 | Category::LibraryApplet}; | ||
| 153 | Setting<AppletMode> web_applet_mode{linkage, AppletMode::HLE, "web_applet_mode", | ||
| 154 | Category::LibraryApplet}; | ||
| 155 | Setting<AppletMode> shop_applet_mode{linkage, AppletMode::HLE, "shop_applet_mode", | ||
| 156 | Category::LibraryApplet}; | ||
| 157 | Setting<AppletMode> photo_viewer_applet_mode{ | ||
| 158 | linkage, AppletMode::LLE, "photo_viewer_applet_mode", Category::LibraryApplet}; | ||
| 159 | Setting<AppletMode> offline_web_applet_mode{linkage, AppletMode::LLE, "offline_web_applet_mode", | ||
| 160 | Category::LibraryApplet}; | ||
| 161 | Setting<AppletMode> login_share_applet_mode{linkage, AppletMode::HLE, "login_share_applet_mode", | ||
| 162 | Category::LibraryApplet}; | ||
| 163 | Setting<AppletMode> wifi_web_auth_applet_mode{ | ||
| 164 | linkage, AppletMode::HLE, "wifi_web_auth_applet_mode", Category::LibraryApplet}; | ||
| 165 | Setting<AppletMode> my_page_applet_mode{linkage, AppletMode::LLE, "my_page_applet_mode", | ||
| 166 | Category::LibraryApplet}; | ||
| 167 | |||
| 136 | // Audio | 168 | // Audio |
| 137 | SwitchableSetting<AudioEngine> sink_id{linkage, AudioEngine::Auto, "output_engine", | 169 | SwitchableSetting<AudioEngine> sink_id{linkage, AudioEngine::Auto, "output_engine", |
| 138 | Category::Audio, Specialization::RuntimeList}; | 170 | Category::Audio, Specialization::RuntimeList}; |
diff --git a/src/common/settings_common.h b/src/common/settings_common.h index 987489e8a..2df3f0809 100644 --- a/src/common/settings_common.h +++ b/src/common/settings_common.h | |||
| @@ -44,6 +44,7 @@ enum class Category : u32 { | |||
| 44 | Services, | 44 | Services, |
| 45 | Paths, | 45 | Paths, |
| 46 | Linux, | 46 | Linux, |
| 47 | LibraryApplet, | ||
| 47 | MaxEnum, | 48 | MaxEnum, |
| 48 | }; | 49 | }; |
| 49 | 50 | ||
diff --git a/src/common/settings_enums.h b/src/common/settings_enums.h index 617036588..f42367e67 100644 --- a/src/common/settings_enums.h +++ b/src/common/settings_enums.h | |||
| @@ -151,6 +151,8 @@ ENUM(AspectRatio, R16_9, R4_3, R21_9, R16_10, Stretch); | |||
| 151 | 151 | ||
| 152 | ENUM(ConsoleMode, Handheld, Docked); | 152 | ENUM(ConsoleMode, Handheld, Docked); |
| 153 | 153 | ||
| 154 | ENUM(AppletMode, HLE, LLE); | ||
| 155 | |||
| 154 | template <typename Type> | 156 | template <typename Type> |
| 155 | inline std::string CanonicalizeEnum(Type id) { | 157 | inline std::string CanonicalizeEnum(Type id) { |
| 156 | const auto group = EnumMetadata<Type>::Canonicalizations(); | 158 | const auto group = EnumMetadata<Type>::Canonicalizations(); |
diff --git a/src/core/hle/service/am/library_applet_creator.cpp b/src/core/hle/service/am/library_applet_creator.cpp index ee646bea5..a883a021e 100644 --- a/src/core/hle/service/am/library_applet_creator.cpp +++ b/src/core/hle/service/am/library_applet_creator.cpp | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project | 1 | // SPDX-FileCopyrightText: Copyright 2024 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 "common/settings.h" | ||
| 4 | #include "core/hle/kernel/k_transfer_memory.h" | 5 | #include "core/hle/kernel/k_transfer_memory.h" |
| 5 | #include "core/hle/service/am/applet_data_broker.h" | 6 | #include "core/hle/service/am/applet_data_broker.h" |
| 6 | #include "core/hle/service/am/applet_manager.h" | 7 | #include "core/hle/service/am/applet_manager.h" |
| @@ -16,6 +17,34 @@ namespace Service::AM { | |||
| 16 | 17 | ||
| 17 | namespace { | 18 | namespace { |
| 18 | 19 | ||
| 20 | bool ShouldCreateGuestApplet(AppletId applet_id) { | ||
| 21 | #define X(Name, name) \ | ||
| 22 | if (applet_id == AppletId::Name && \ | ||
| 23 | Settings::values.name##_applet_mode.GetValue() != Settings::AppletMode::LLE) { \ | ||
| 24 | return false; \ | ||
| 25 | } | ||
| 26 | |||
| 27 | X(Cabinet, cabinet) | ||
| 28 | X(Controller, controller) | ||
| 29 | X(DataErase, data_erase) | ||
| 30 | X(Error, error) | ||
| 31 | X(NetConnect, net_connect) | ||
| 32 | X(ProfileSelect, player_select) | ||
| 33 | X(SoftwareKeyboard, swkbd) | ||
| 34 | X(MiiEdit, mii_edit) | ||
| 35 | X(Web, web) | ||
| 36 | X(Shop, shop) | ||
| 37 | X(PhotoViewer, photo_viewer) | ||
| 38 | X(OfflineWeb, offline_web) | ||
| 39 | X(LoginShare, login_share) | ||
| 40 | X(WebAuth, wifi_web_auth) | ||
| 41 | X(MyPage, my_page) | ||
| 42 | |||
| 43 | #undef X | ||
| 44 | |||
| 45 | return true; | ||
| 46 | } | ||
| 47 | |||
| 19 | AppletProgramId AppletIdToProgramId(AppletId applet_id) { | 48 | AppletProgramId AppletIdToProgramId(AppletId applet_id) { |
| 20 | switch (applet_id) { | 49 | switch (applet_id) { |
| 21 | case AppletId::OverlayDisplay: | 50 | case AppletId::OverlayDisplay: |
| @@ -63,9 +92,10 @@ AppletProgramId AppletIdToProgramId(AppletId applet_id) { | |||
| 63 | } | 92 | } |
| 64 | } | 93 | } |
| 65 | 94 | ||
| 66 | [[maybe_unused]] std::shared_ptr<ILibraryAppletAccessor> CreateGuestApplet( | 95 | std::shared_ptr<ILibraryAppletAccessor> CreateGuestApplet(Core::System& system, |
| 67 | Core::System& system, std::shared_ptr<Applet> caller_applet, AppletId applet_id, | 96 | std::shared_ptr<Applet> caller_applet, |
| 68 | LibraryAppletMode mode) { | 97 | AppletId applet_id, |
| 98 | LibraryAppletMode mode) { | ||
| 69 | const auto program_id = static_cast<u64>(AppletIdToProgramId(applet_id)); | 99 | const auto program_id = static_cast<u64>(AppletIdToProgramId(applet_id)); |
| 70 | if (program_id == 0) { | 100 | if (program_id == 0) { |
| 71 | // Unknown applet | 101 | // Unknown applet |
| @@ -117,9 +147,10 @@ AppletProgramId AppletIdToProgramId(AppletId applet_id) { | |||
| 117 | return std::make_shared<ILibraryAppletAccessor>(system, broker, applet); | 147 | return std::make_shared<ILibraryAppletAccessor>(system, broker, applet); |
| 118 | } | 148 | } |
| 119 | 149 | ||
| 120 | [[maybe_unused]] std::shared_ptr<ILibraryAppletAccessor> CreateFrontendApplet( | 150 | std::shared_ptr<ILibraryAppletAccessor> CreateFrontendApplet(Core::System& system, |
| 121 | Core::System& system, std::shared_ptr<Applet> caller_applet, AppletId applet_id, | 151 | std::shared_ptr<Applet> caller_applet, |
| 122 | LibraryAppletMode mode) { | 152 | AppletId applet_id, |
| 153 | LibraryAppletMode mode) { | ||
| 123 | const auto program_id = static_cast<u64>(AppletIdToProgramId(applet_id)); | 154 | const auto program_id = static_cast<u64>(AppletIdToProgramId(applet_id)); |
| 124 | 155 | ||
| 125 | auto process = std::make_unique<Process>(system); | 156 | auto process = std::make_unique<Process>(system); |
| @@ -163,7 +194,13 @@ void ILibraryAppletCreator::CreateLibraryApplet(HLERequestContext& ctx) { | |||
| 163 | LOG_DEBUG(Service_AM, "called with applet_id={:08X}, applet_mode={:08X}", applet_id, | 194 | LOG_DEBUG(Service_AM, "called with applet_id={:08X}, applet_mode={:08X}", applet_id, |
| 164 | applet_mode); | 195 | applet_mode); |
| 165 | 196 | ||
| 166 | auto library_applet = CreateFrontendApplet(system, applet, applet_id, applet_mode); | 197 | std::shared_ptr<ILibraryAppletAccessor> library_applet; |
| 198 | if (ShouldCreateGuestApplet(applet_id)) { | ||
| 199 | library_applet = CreateGuestApplet(system, applet, applet_id, applet_mode); | ||
| 200 | } | ||
| 201 | if (!library_applet) { | ||
| 202 | library_applet = CreateFrontendApplet(system, applet, applet_id, applet_mode); | ||
| 203 | } | ||
| 167 | if (!library_applet) { | 204 | if (!library_applet) { |
| 168 | LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id); | 205 | LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id); |
| 169 | 206 | ||
diff --git a/src/frontend_common/config.cpp b/src/frontend_common/config.cpp index d34624d28..cbbb07ac7 100644 --- a/src/frontend_common/config.cpp +++ b/src/frontend_common/config.cpp | |||
| @@ -401,6 +401,14 @@ void Config::ReadNetworkValues() { | |||
| 401 | EndGroup(); | 401 | EndGroup(); |
| 402 | } | 402 | } |
| 403 | 403 | ||
| 404 | void Config::ReadLibraryAppletValues() { | ||
| 405 | BeginGroup(Settings::TranslateCategory(Settings::Category::LibraryApplet)); | ||
| 406 | |||
| 407 | ReadCategory(Settings::Category::LibraryApplet); | ||
| 408 | |||
| 409 | EndGroup(); | ||
| 410 | } | ||
| 411 | |||
| 404 | void Config::ReadValues() { | 412 | void Config::ReadValues() { |
| 405 | if (global) { | 413 | if (global) { |
| 406 | ReadDataStorageValues(); | 414 | ReadDataStorageValues(); |
| @@ -410,6 +418,7 @@ void Config::ReadValues() { | |||
| 410 | ReadServiceValues(); | 418 | ReadServiceValues(); |
| 411 | ReadWebServiceValues(); | 419 | ReadWebServiceValues(); |
| 412 | ReadMiscellaneousValues(); | 420 | ReadMiscellaneousValues(); |
| 421 | ReadLibraryAppletValues(); | ||
| 413 | } | 422 | } |
| 414 | ReadControlValues(); | 423 | ReadControlValues(); |
| 415 | ReadCoreValues(); | 424 | ReadCoreValues(); |
| @@ -511,6 +520,7 @@ void Config::SaveValues() { | |||
| 511 | SaveNetworkValues(); | 520 | SaveNetworkValues(); |
| 512 | SaveWebServiceValues(); | 521 | SaveWebServiceValues(); |
| 513 | SaveMiscellaneousValues(); | 522 | SaveMiscellaneousValues(); |
| 523 | SaveLibraryAppletValues(); | ||
| 514 | } else { | 524 | } else { |
| 515 | LOG_DEBUG(Config, "Saving only generic configuration values"); | 525 | LOG_DEBUG(Config, "Saving only generic configuration values"); |
| 516 | } | 526 | } |
| @@ -691,6 +701,14 @@ void Config::SaveWebServiceValues() { | |||
| 691 | EndGroup(); | 701 | EndGroup(); |
| 692 | } | 702 | } |
| 693 | 703 | ||
| 704 | void Config::SaveLibraryAppletValues() { | ||
| 705 | BeginGroup(Settings::TranslateCategory(Settings::Category::LibraryApplet)); | ||
| 706 | |||
| 707 | WriteCategory(Settings::Category::LibraryApplet); | ||
| 708 | |||
| 709 | EndGroup(); | ||
| 710 | } | ||
| 711 | |||
| 694 | bool Config::ReadBooleanSetting(const std::string& key, const std::optional<bool> default_value) { | 712 | bool Config::ReadBooleanSetting(const std::string& key, const std::optional<bool> default_value) { |
| 695 | std::string full_key = GetFullKey(key, false); | 713 | std::string full_key = GetFullKey(key, false); |
| 696 | if (!default_value.has_value()) { | 714 | if (!default_value.has_value()) { |
diff --git a/src/frontend_common/config.h b/src/frontend_common/config.h index 4ecb97044..8b0599cc3 100644 --- a/src/frontend_common/config.h +++ b/src/frontend_common/config.h | |||
| @@ -88,6 +88,7 @@ protected: | |||
| 88 | void ReadSystemValues(); | 88 | void ReadSystemValues(); |
| 89 | void ReadWebServiceValues(); | 89 | void ReadWebServiceValues(); |
| 90 | void ReadNetworkValues(); | 90 | void ReadNetworkValues(); |
| 91 | void ReadLibraryAppletValues(); | ||
| 91 | 92 | ||
| 92 | // Read platform specific sections | 93 | // Read platform specific sections |
| 93 | virtual void ReadHidbusValues() = 0; | 94 | virtual void ReadHidbusValues() = 0; |
| @@ -121,6 +122,7 @@ protected: | |||
| 121 | void SaveScreenshotValues(); | 122 | void SaveScreenshotValues(); |
| 122 | void SaveSystemValues(); | 123 | void SaveSystemValues(); |
| 123 | void SaveWebServiceValues(); | 124 | void SaveWebServiceValues(); |
| 125 | void SaveLibraryAppletValues(); | ||
| 124 | 126 | ||
| 125 | // Save platform specific sections | 127 | // Save platform specific sections |
| 126 | virtual void SaveHidbusValues() = 0; | 128 | virtual void SaveHidbusValues() = 0; |
diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 76f06da12..0259a8c29 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt | |||
| @@ -41,6 +41,9 @@ add_executable(yuzu | |||
| 41 | configuration/configuration_shared.cpp | 41 | configuration/configuration_shared.cpp |
| 42 | configuration/configuration_shared.h | 42 | configuration/configuration_shared.h |
| 43 | configuration/configure.ui | 43 | configuration/configure.ui |
| 44 | configuration/configure_applets.cpp | ||
| 45 | configuration/configure_applets.h | ||
| 46 | configuration/configure_applets.ui | ||
| 44 | configuration/configure_audio.cpp | 47 | configuration/configure_audio.cpp |
| 45 | configuration/configure_audio.h | 48 | configuration/configure_audio.h |
| 46 | configuration/configure_audio.ui | 49 | configuration/configure_audio.ui |
diff --git a/src/yuzu/configuration/configure_applets.cpp b/src/yuzu/configuration/configure_applets.cpp new file mode 100644 index 000000000..513ecb548 --- /dev/null +++ b/src/yuzu/configuration/configure_applets.cpp | |||
| @@ -0,0 +1,86 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #include "common/settings.h" | ||
| 5 | #include "core/core.h" | ||
| 6 | #include "ui_configure_applets.h" | ||
| 7 | #include "yuzu/configuration/configuration_shared.h" | ||
| 8 | #include "yuzu/configuration/configure_applets.h" | ||
| 9 | #include "yuzu/configuration/shared_widget.h" | ||
| 10 | |||
| 11 | ConfigureApplets::ConfigureApplets(Core::System& system_, | ||
| 12 | std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group_, | ||
| 13 | const ConfigurationShared::Builder& builder, QWidget* parent) | ||
| 14 | : Tab(group_, parent), ui{std::make_unique<Ui::ConfigureApplets>()}, system{system_} { | ||
| 15 | ui->setupUi(this); | ||
| 16 | |||
| 17 | Setup(builder); | ||
| 18 | |||
| 19 | SetConfiguration(); | ||
| 20 | } | ||
| 21 | |||
| 22 | ConfigureApplets::~ConfigureApplets() = default; | ||
| 23 | |||
| 24 | void ConfigureApplets::changeEvent(QEvent* event) { | ||
| 25 | if (event->type() == QEvent::LanguageChange) { | ||
| 26 | RetranslateUI(); | ||
| 27 | } | ||
| 28 | |||
| 29 | QWidget::changeEvent(event); | ||
| 30 | } | ||
| 31 | |||
| 32 | void ConfigureApplets::RetranslateUI() { | ||
| 33 | ui->retranslateUi(this); | ||
| 34 | } | ||
| 35 | |||
| 36 | void ConfigureApplets::Setup(const ConfigurationShared::Builder& builder) { | ||
| 37 | auto& library_applets_layout = *ui->group_library_applet_modes->layout(); | ||
| 38 | std::map<u32, QWidget*> applets_hold{}; | ||
| 39 | |||
| 40 | std::vector<Settings::BasicSetting*> settings; | ||
| 41 | auto push = [&settings](auto& list) { | ||
| 42 | for (auto setting : list) { | ||
| 43 | settings.push_back(setting); | ||
| 44 | } | ||
| 45 | }; | ||
| 46 | |||
| 47 | push(Settings::values.linkage.by_category[Settings::Category::LibraryApplet]); | ||
| 48 | |||
| 49 | for (auto setting : settings) { | ||
| 50 | ConfigurationShared::Widget* widget = builder.BuildWidget(setting, apply_funcs); | ||
| 51 | |||
| 52 | if (widget == nullptr) { | ||
| 53 | continue; | ||
| 54 | } | ||
| 55 | if (!widget->Valid()) { | ||
| 56 | widget->deleteLater(); | ||
| 57 | continue; | ||
| 58 | } | ||
| 59 | |||
| 60 | // Untested applets | ||
| 61 | if (setting->Id() == Settings::values.data_erase_applet_mode.Id() || | ||
| 62 | setting->Id() == Settings::values.error_applet_mode.Id() || | ||
| 63 | setting->Id() == Settings::values.net_connect_applet_mode.Id() || | ||
| 64 | setting->Id() == Settings::values.web_applet_mode.Id() || | ||
| 65 | setting->Id() == Settings::values.shop_applet_mode.Id() || | ||
| 66 | setting->Id() == Settings::values.login_share_applet_mode.Id() || | ||
| 67 | setting->Id() == Settings::values.wifi_web_auth_applet_mode.Id() || | ||
| 68 | setting->Id() == Settings::values.my_page_applet_mode.Id()) { | ||
| 69 | widget->setHidden(true); | ||
| 70 | } | ||
| 71 | |||
| 72 | applets_hold.emplace(setting->Id(), widget); | ||
| 73 | } | ||
| 74 | for (const auto& [label, widget] : applets_hold) { | ||
| 75 | library_applets_layout.addWidget(widget); | ||
| 76 | } | ||
| 77 | } | ||
| 78 | |||
| 79 | void ConfigureApplets::SetConfiguration() {} | ||
| 80 | |||
| 81 | void ConfigureApplets::ApplyConfiguration() { | ||
| 82 | const bool powered_on = system.IsPoweredOn(); | ||
| 83 | for (const auto& func : apply_funcs) { | ||
| 84 | func(powered_on); | ||
| 85 | } | ||
| 86 | } | ||
diff --git a/src/yuzu/configuration/configure_applets.h b/src/yuzu/configuration/configure_applets.h new file mode 100644 index 000000000..54f494d2f --- /dev/null +++ b/src/yuzu/configuration/configure_applets.h | |||
| @@ -0,0 +1,48 @@ | |||
| 1 | // SPDX-FileCopyrightText: 2024 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <QWidget> | ||
| 7 | #include "yuzu/configuration/configuration_shared.h" | ||
| 8 | |||
| 9 | class QCheckBox; | ||
| 10 | class QLineEdit; | ||
| 11 | class QComboBox; | ||
| 12 | class QDateTimeEdit; | ||
| 13 | namespace Core { | ||
| 14 | class System; | ||
| 15 | } | ||
| 16 | |||
| 17 | namespace Ui { | ||
| 18 | class ConfigureApplets; | ||
| 19 | } | ||
| 20 | |||
| 21 | namespace ConfigurationShared { | ||
| 22 | class Builder; | ||
| 23 | } | ||
| 24 | |||
| 25 | class ConfigureApplets : public ConfigurationShared::Tab { | ||
| 26 | public: | ||
| 27 | explicit ConfigureApplets(Core::System& system_, | ||
| 28 | std::shared_ptr<std::vector<ConfigurationShared::Tab*>> group, | ||
| 29 | const ConfigurationShared::Builder& builder, | ||
| 30 | QWidget* parent = nullptr); | ||
| 31 | ~ConfigureApplets() override; | ||
| 32 | |||
| 33 | void ApplyConfiguration() override; | ||
| 34 | void SetConfiguration() override; | ||
| 35 | |||
| 36 | private: | ||
| 37 | void changeEvent(QEvent* event) override; | ||
| 38 | void RetranslateUI(); | ||
| 39 | |||
| 40 | void Setup(const ConfigurationShared::Builder& builder); | ||
| 41 | |||
| 42 | std::vector<std::function<void(bool)>> apply_funcs{}; | ||
| 43 | |||
| 44 | std::unique_ptr<Ui::ConfigureApplets> ui; | ||
| 45 | bool enabled = false; | ||
| 46 | |||
| 47 | Core::System& system; | ||
| 48 | }; | ||
diff --git a/src/yuzu/configuration/configure_applets.ui b/src/yuzu/configuration/configure_applets.ui new file mode 100644 index 000000000..6f2ca66bd --- /dev/null +++ b/src/yuzu/configuration/configure_applets.ui | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 2 | <ui version="4.0"> | ||
| 3 | <class>ConfigureApplets</class> | ||
| 4 | <widget class="QWidget" name="ConfigureApplets"> | ||
| 5 | <property name="geometry"> | ||
| 6 | <rect> | ||
| 7 | <x>0</x> | ||
| 8 | <y>0</y> | ||
| 9 | <width>605</width> | ||
| 10 | <height>300</height> | ||
| 11 | </rect> | ||
| 12 | </property> | ||
| 13 | <property name="windowTitle"> | ||
| 14 | <string>Form</string> | ||
| 15 | </property> | ||
| 16 | <property name="accessibleName"> | ||
| 17 | <string>Applets</string> | ||
| 18 | </property> | ||
| 19 | <layout class="QVBoxLayout" name="verticalLayout_1"> | ||
| 20 | <item> | ||
| 21 | <layout class="QVBoxLayout" name="verticalLayout"> | ||
| 22 | <item> | ||
| 23 | <widget class="QGroupBox" name="group_library_applet_modes"> | ||
| 24 | <property name="title"> | ||
| 25 | <string>Applet mode preference</string> | ||
| 26 | </property> | ||
| 27 | <layout class="QVBoxLayout"> | ||
| 28 | <item> | ||
| 29 | <widget class="QWidget" name="applets_widget" native="true"> | ||
| 30 | <layout class="QVBoxLayout" name="verticalLayout_3"> | ||
| 31 | <property name="leftMargin"> | ||
| 32 | <number>0</number> | ||
| 33 | </property> | ||
| 34 | <property name="topMargin"> | ||
| 35 | <number>0</number> | ||
| 36 | </property> | ||
| 37 | <property name="rightMargin"> | ||
| 38 | <number>0</number> | ||
| 39 | </property> | ||
| 40 | </layout> | ||
| 41 | </widget> | ||
| 42 | </item> | ||
| 43 | </layout> | ||
| 44 | </widget> | ||
| 45 | </item> | ||
| 46 | </layout> | ||
| 47 | </item> | ||
| 48 | <item> | ||
| 49 | <spacer name="verticalSpacer"> | ||
| 50 | <property name="orientation"> | ||
| 51 | <enum>Qt::Vertical</enum> | ||
| 52 | </property> | ||
| 53 | <property name="sizeHint" stdset="0"> | ||
| 54 | <size> | ||
| 55 | <width>20</width> | ||
| 56 | <height>40</height> | ||
| 57 | </size> | ||
| 58 | </property> | ||
| 59 | </spacer> | ||
| 60 | </item> | ||
| 61 | </layout> | ||
| 62 | </widget> | ||
| 63 | <resources/> | ||
| 64 | <connections/> | ||
| 65 | </ui> | ||
diff --git a/src/yuzu/configuration/configure_dialog.cpp b/src/yuzu/configuration/configure_dialog.cpp index aab54a1cc..37f23388e 100644 --- a/src/yuzu/configuration/configure_dialog.cpp +++ b/src/yuzu/configuration/configure_dialog.cpp | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | #include "core/core.h" | 8 | #include "core/core.h" |
| 9 | #include "ui_configure.h" | 9 | #include "ui_configure.h" |
| 10 | #include "vk_device_info.h" | 10 | #include "vk_device_info.h" |
| 11 | #include "yuzu/configuration/configure_applets.h" | ||
| 11 | #include "yuzu/configuration/configure_audio.h" | 12 | #include "yuzu/configuration/configure_audio.h" |
| 12 | #include "yuzu/configuration/configure_cpu.h" | 13 | #include "yuzu/configuration/configure_cpu.h" |
| 13 | #include "yuzu/configuration/configure_debug_tab.h" | 14 | #include "yuzu/configuration/configure_debug_tab.h" |
| @@ -34,6 +35,7 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, | |||
| 34 | : QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, | 35 | : QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, |
| 35 | registry(registry_), system{system_}, builder{std::make_unique<ConfigurationShared::Builder>( | 36 | registry(registry_), system{system_}, builder{std::make_unique<ConfigurationShared::Builder>( |
| 36 | this, !system_.IsPoweredOn())}, | 37 | this, !system_.IsPoweredOn())}, |
| 38 | applets_tab{std::make_unique<ConfigureApplets>(system_, nullptr, *builder, this)}, | ||
| 37 | audio_tab{std::make_unique<ConfigureAudio>(system_, nullptr, *builder, this)}, | 39 | audio_tab{std::make_unique<ConfigureAudio>(system_, nullptr, *builder, this)}, |
| 38 | cpu_tab{std::make_unique<ConfigureCpu>(system_, nullptr, *builder, this)}, | 40 | cpu_tab{std::make_unique<ConfigureCpu>(system_, nullptr, *builder, this)}, |
| 39 | debug_tab_tab{std::make_unique<ConfigureDebugTab>(system_, this)}, | 41 | debug_tab_tab{std::make_unique<ConfigureDebugTab>(system_, this)}, |
| @@ -58,6 +60,7 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_, | |||
| 58 | 60 | ||
| 59 | ui->setupUi(this); | 61 | ui->setupUi(this); |
| 60 | 62 | ||
| 63 | ui->tabWidget->addTab(applets_tab.get(), tr("Applets")); | ||
| 61 | ui->tabWidget->addTab(audio_tab.get(), tr("Audio")); | 64 | ui->tabWidget->addTab(audio_tab.get(), tr("Audio")); |
| 62 | ui->tabWidget->addTab(cpu_tab.get(), tr("CPU")); | 65 | ui->tabWidget->addTab(cpu_tab.get(), tr("CPU")); |
| 63 | ui->tabWidget->addTab(debug_tab_tab.get(), tr("Debug")); | 66 | ui->tabWidget->addTab(debug_tab_tab.get(), tr("Debug")); |
| @@ -124,6 +127,7 @@ void ConfigureDialog::ApplyConfiguration() { | |||
| 124 | debug_tab_tab->ApplyConfiguration(); | 127 | debug_tab_tab->ApplyConfiguration(); |
| 125 | web_tab->ApplyConfiguration(); | 128 | web_tab->ApplyConfiguration(); |
| 126 | network_tab->ApplyConfiguration(); | 129 | network_tab->ApplyConfiguration(); |
| 130 | applets_tab->ApplyConfiguration(); | ||
| 127 | system.ApplySettings(); | 131 | system.ApplySettings(); |
| 128 | Settings::LogSettings(); | 132 | Settings::LogSettings(); |
| 129 | } | 133 | } |
| @@ -161,7 +165,8 @@ void ConfigureDialog::PopulateSelectionList() { | |||
| 161 | {{tr("General"), | 165 | {{tr("General"), |
| 162 | {general_tab.get(), hotkeys_tab.get(), ui_tab.get(), web_tab.get(), debug_tab_tab.get()}}, | 166 | {general_tab.get(), hotkeys_tab.get(), ui_tab.get(), web_tab.get(), debug_tab_tab.get()}}, |
| 163 | {tr("System"), | 167 | {tr("System"), |
| 164 | {system_tab.get(), profile_tab.get(), network_tab.get(), filesystem_tab.get()}}, | 168 | {system_tab.get(), profile_tab.get(), network_tab.get(), filesystem_tab.get(), |
| 169 | applets_tab.get()}}, | ||
| 165 | {tr("CPU"), {cpu_tab.get()}}, | 170 | {tr("CPU"), {cpu_tab.get()}}, |
| 166 | {tr("Graphics"), {graphics_tab.get(), graphics_advanced_tab.get()}}, | 171 | {tr("Graphics"), {graphics_tab.get(), graphics_advanced_tab.get()}}, |
| 167 | {tr("Audio"), {audio_tab.get()}}, | 172 | {tr("Audio"), {audio_tab.get()}}, |
diff --git a/src/yuzu/configuration/configure_dialog.h b/src/yuzu/configuration/configure_dialog.h index b28ce288c..d0a24a07b 100644 --- a/src/yuzu/configuration/configure_dialog.h +++ b/src/yuzu/configuration/configure_dialog.h | |||
| @@ -15,6 +15,7 @@ namespace Core { | |||
| 15 | class System; | 15 | class System; |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | class ConfigureApplets; | ||
| 18 | class ConfigureAudio; | 19 | class ConfigureAudio; |
| 19 | class ConfigureCpu; | 20 | class ConfigureCpu; |
| 20 | class ConfigureDebugTab; | 21 | class ConfigureDebugTab; |
| @@ -75,6 +76,7 @@ private: | |||
| 75 | std::unique_ptr<ConfigurationShared::Builder> builder; | 76 | std::unique_ptr<ConfigurationShared::Builder> builder; |
| 76 | std::vector<ConfigurationShared::Tab*> tab_group; | 77 | std::vector<ConfigurationShared::Tab*> tab_group; |
| 77 | 78 | ||
| 79 | std::unique_ptr<ConfigureApplets> applets_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; |
| 80 | std::unique_ptr<ConfigureDebugTab> debug_tab_tab; | 82 | std::unique_ptr<ConfigureDebugTab> debug_tab_tab; |
diff --git a/src/yuzu/configuration/shared_translation.cpp b/src/yuzu/configuration/shared_translation.cpp index ed9c7d859..ce65b2bf1 100644 --- a/src/yuzu/configuration/shared_translation.cpp +++ b/src/yuzu/configuration/shared_translation.cpp | |||
| @@ -26,6 +26,23 @@ std::unique_ptr<TranslationMap> InitializeTranslations(QWidget* parent) { | |||
| 26 | 26 | ||
| 27 | // A setting can be ignored by giving it a blank name | 27 | // A setting can be ignored by giving it a blank name |
| 28 | 28 | ||
| 29 | // Applets | ||
| 30 | INSERT(Settings, cabinet_applet_mode, tr("Amiibo editor"), QStringLiteral()); | ||
| 31 | INSERT(Settings, controller_applet_mode, tr("Controller configuration"), QStringLiteral()); | ||
| 32 | INSERT(Settings, data_erase_applet_mode, tr("Data erase"), QStringLiteral()); | ||
| 33 | INSERT(Settings, error_applet_mode, tr("Error"), QStringLiteral()); | ||
| 34 | INSERT(Settings, net_connect_applet_mode, tr("Net connect"), QStringLiteral()); | ||
| 35 | INSERT(Settings, player_select_applet_mode, tr("Player select"), QStringLiteral()); | ||
| 36 | INSERT(Settings, swkbd_applet_mode, tr("Software keyboard"), QStringLiteral()); | ||
| 37 | INSERT(Settings, mii_edit_applet_mode, tr("Mii Edit"), QStringLiteral()); | ||
| 38 | INSERT(Settings, web_applet_mode, tr("Online web"), QStringLiteral()); | ||
| 39 | INSERT(Settings, shop_applet_mode, tr("Shop"), QStringLiteral()); | ||
| 40 | INSERT(Settings, photo_viewer_applet_mode, tr("Photo viewer"), QStringLiteral()); | ||
| 41 | INSERT(Settings, offline_web_applet_mode, tr("Offline web"), QStringLiteral()); | ||
| 42 | INSERT(Settings, login_share_applet_mode, tr("Login share"), QStringLiteral()); | ||
| 43 | INSERT(Settings, wifi_web_auth_applet_mode, tr("Wifi web auth"), QStringLiteral()); | ||
| 44 | INSERT(Settings, my_page_applet_mode, tr("My page"), QStringLiteral()); | ||
| 45 | |||
| 29 | // Audio | 46 | // Audio |
| 30 | INSERT(Settings, sink_id, tr("Output Engine:"), QStringLiteral()); | 47 | INSERT(Settings, sink_id, tr("Output Engine:"), QStringLiteral()); |
| 31 | INSERT(Settings, audio_output_device_id, tr("Output Device:"), QStringLiteral()); | 48 | INSERT(Settings, audio_output_device_id, tr("Output Device:"), QStringLiteral()); |
| @@ -203,6 +220,11 @@ std::unique_ptr<ComboboxTranslationMap> ComboboxEnumeration(QWidget* parent) { | |||
| 203 | #define PAIR(ENUM, VALUE, TRANSLATION) {static_cast<u32>(Settings::ENUM::VALUE), (TRANSLATION)} | 220 | #define PAIR(ENUM, VALUE, TRANSLATION) {static_cast<u32>(Settings::ENUM::VALUE), (TRANSLATION)} |
| 204 | 221 | ||
| 205 | // Intentionally skipping VSyncMode to let the UI fill that one out | 222 | // Intentionally skipping VSyncMode to let the UI fill that one out |
| 223 | translations->insert({Settings::EnumMetadata<Settings::AppletMode>::Index(), | ||
| 224 | { | ||
| 225 | PAIR(AppletMode, HLE, tr("Custom frontend")), | ||
| 226 | PAIR(AppletMode, LLE, tr("Real applet")), | ||
| 227 | }}); | ||
| 206 | 228 | ||
| 207 | translations->insert({Settings::EnumMetadata<Settings::AstcDecodeMode>::Index(), | 229 | translations->insert({Settings::EnumMetadata<Settings::AstcDecodeMode>::Index(), |
| 208 | { | 230 | { |