From 63e11ca37737bd08db3835b1f77c2e8c0fd9db41 Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Sun, 21 Sep 2025 22:13:53 +0100 Subject: [PATCH] remove unused 12h clock option. add option to hide ip address. --- sphaira/include/app.hpp | 3 +-- sphaira/source/app.cpp | 17 +++++------------ sphaira/source/ui/menus/menu_base.cpp | 2 +- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/sphaira/include/app.hpp b/sphaira/include/app.hpp index efd584c..1ffb11b 100644 --- a/sphaira/include/app.hpp +++ b/sphaira/include/app.hpp @@ -95,7 +95,6 @@ public: static auto GetInstallEmummcEnable() -> bool; static auto GetInstallSdEnable() -> bool; static auto GetThemeMusicEnable() -> bool; - static auto Get12HourTimeEnable() -> bool; static auto GetLanguage() -> long; static auto GetTextScrollSpeed() -> long; @@ -303,7 +302,7 @@ public: option::OptionString m_default_music{INI_SECTION, "default_music", "/config/sphaira/themes/default_music.bfstm"}; option::OptionString m_theme_path{INI_SECTION, "theme", DEFAULT_THEME_PATH}; option::OptionBool m_theme_music{INI_SECTION, "theme_music", true}; - option::OptionBool m_12hour_time{INI_SECTION, "12hour_time", false}; + option::OptionBool m_show_ip_addr{INI_SECTION, "show_ip_addr", true}; option::OptionLong m_language{INI_SECTION, "language", 0}; // auto option::OptionString m_left_menu{INI_SECTION, "left_side_menu", "FileBrowser"}; option::OptionString m_right_menu{INI_SECTION, "right_side_menu", "Appstore"}; diff --git a/sphaira/source/app.cpp b/sphaira/source/app.cpp index b435968..b2741d8 100644 --- a/sphaira/source/app.cpp +++ b/sphaira/source/app.cpp @@ -752,10 +752,6 @@ auto App::GetTextScrollSpeed() -> long { return g_app->m_text_scroll_speed.Get(); } -auto App::Get12HourTimeEnable() -> bool { - return g_app->m_12hour_time.Get(); -} - auto App::GetNszCompressLevel() -> u8 { return NSZ_COMPRESS_LEVEL_OPTIONS[App::GetApp()->m_nsz_compress_level.Get()].value; } @@ -942,10 +938,6 @@ void App::SetThemeMusicEnable(bool enable) { } } -void App::Set12HourTimeEnable(bool enable) { - g_app->m_12hour_time.Set(enable); -} - void App::SetMtpEnable(bool enable) { if (App::GetMtpEnable() != enable) { g_app->m_mtp_enabled.Set(enable); @@ -1512,7 +1504,7 @@ App::App(const char* argv0) { else if (app->m_default_music.LoadFrom(Key, Value)) {} else if (app->m_theme_path.LoadFrom(Key, Value)) {} else if (app->m_theme_music.LoadFrom(Key, Value)) {} - else if (app->m_12hour_time.LoadFrom(Key, Value)) {} + else if (app->m_show_ip_addr.LoadFrom(Key, Value)) {} else if (app->m_language.LoadFrom(Key, Value)) {} else if (app->m_left_menu.LoadFrom(Key, Value)) {} else if (app->m_right_menu.LoadFrom(Key, Value)) {} @@ -1970,9 +1962,10 @@ void App::DisplayThemeOptions(bool left_side) { "Each theme can have it's own music file. " "If a theme does not set a music file, the default music is loaded instead (if it exists)."_i18n); - options->Add("12 Hour Time"_i18n, App::Get12HourTimeEnable(), [](bool& enable){ - App::Set12HourTimeEnable(enable); - }, "Changes the clock to 12 hour"_i18n); + options->Add("Show IP address"_i18n, App::GetApp()->m_show_ip_addr, + "Shows the IP address in all menus, including the WiFi strength.\n\n" + "NOTE: The IP address will be hidden in applet mode due to the applet warning being displayed in it's place."_i18n + ); // todo: add file picker for music here. // todo: add array to audio which has the list of supported extensions. diff --git a/sphaira/source/ui/menus/menu_base.cpp b/sphaira/source/ui/menus/menu_base.cpp index bc53348..ef31897 100644 --- a/sphaira/source/ui/menus/menu_base.cpp +++ b/sphaira/source/ui/menus/menu_base.cpp @@ -111,7 +111,7 @@ void MenuBase::Draw(NVGcontext* vg, Theme* theme) { // ran out of space, its one or the other. if (!App::IsApplication()) { draw(ThemeEntryID_ERROR, 0, ("[Applet Mode]"_i18n).c_str()); - } else { + } else if (App::GetApp()->m_show_ip_addr.Get()) { if (pdata.ip) { char ip_buf[32]; std::snprintf(ip_buf, sizeof(ip_buf), "%u.%u.%u.%u", pdata.ip & 0xFF, (pdata.ip >> 8) & 0xFF, (pdata.ip >> 16) & 0xFF, (pdata.ip >> 24) & 0xFF);