| 205 | } |
| 206 | |
| 207 | void LoadSettings() { |
| 208 | g_SettingMenuEntries.clear(); |
| 209 | |
| 210 | g_SettingMenuEntries.push_back({ |
| 211 | .menu = SettingMenu::System, |
| 212 | .setting = Setting::ConsoleRegion, |
| 213 | .editable = false, |
| 214 | .static_description = GetLanguageString("set_region"), |
| 215 | .static_value = FormatRegion(g_GlobalSettings.region) |
| 216 | }); |
| 217 | |
| 218 | g_SettingMenuEntries.push_back({ |
| 219 | .menu = SettingMenu::System, |
| 220 | .setting = Setting::SystemUpdateStatus, |
| 221 | .editable = false, |
| 222 | .static_description = GetLanguageString("set_update"), |
| 223 | .dyn_value_cb = []() { |
| 224 | u8 latest_upd_value = 0xFF; |
| 225 | if(R_SUCCEEDED(GetLatestSystemUpdate(latest_upd_value))) { |
| 226 | return FormatLatestSystemUpdate(latest_upd_value); |
| 227 | } |
| 228 | else { |
| 229 | return GetLanguageString("set_update_no_connection"); |
| 230 | } |
| 231 | } |
| 232 | }); |
| 233 | |
| 234 | g_SettingMenuEntries.push_back({ |
| 235 | .menu = SettingMenu::Screen, |
| 236 | .setting = Setting::LockscreenEnabled, |
| 237 | .editable = true, |
| 238 | .static_description = GetLanguageString("set_lockscreen"), |
| 239 | .dyn_value_cb = []() { |
| 240 | bool lockscreen_enabled; |
| 241 | UL_ASSERT_TRUE(g_GlobalSettings.config.GetEntry(cfg::ConfigEntryId::LockscreenEnabled, lockscreen_enabled)); |
| 242 | return FormatBoolean(lockscreen_enabled); |
| 243 | }, |
| 244 | .select_cb = [](SettingSubmenu&) { |
| 245 | bool lockscreen_enabled; |
| 246 | UL_ASSERT_TRUE(g_GlobalSettings.config.GetEntry(cfg::ConfigEntryId::LockscreenEnabled, lockscreen_enabled)); |
| 247 | UL_ASSERT_TRUE(g_GlobalSettings.config.SetEntry(cfg::ConfigEntryId::LockscreenEnabled, !lockscreen_enabled)); |
| 248 | return SettingResult::Changed; |
| 249 | } |
| 250 | }); |
| 251 | |
| 252 | g_SettingMenuEntries.push_back({ |
| 253 | .menu = SettingMenu::Screen, |
| 254 | .setting = Setting::PrimaryAlbumStorage, |
| 255 | .editable = true, |
| 256 | .static_description = GetLanguageString("set_album"), |
| 257 | .dyn_value_cb = []() { |
| 258 | return FormatPrimaryAlbumStorage(g_GlobalSettings.album_storage); |
| 259 | }, |
| 260 | .select_cb = [](SettingSubmenu&) { |
| 261 | const auto opt = g_MenuApplication->DisplayDialog(GetLanguageString("set_album"), GetLanguageString("set_enum_options"), { |
| 262 | GetLanguageString("set_album_sd"), |
| 263 | GetLanguageString("set_album_nand"), |
| 264 | GetLanguageString("cancel") |
no test coverage detected