remove unused 12h clock option. add option to hide ip address.

This commit is contained in:
ITotalJustice
2025-09-21 22:13:53 +01:00
parent 54a2215e04
commit 63e11ca377
3 changed files with 7 additions and 15 deletions

View File

@@ -95,7 +95,6 @@ public:
static auto GetInstallEmummcEnable() -> bool; static auto GetInstallEmummcEnable() -> bool;
static auto GetInstallSdEnable() -> bool; static auto GetInstallSdEnable() -> bool;
static auto GetThemeMusicEnable() -> bool; static auto GetThemeMusicEnable() -> bool;
static auto Get12HourTimeEnable() -> bool;
static auto GetLanguage() -> long; static auto GetLanguage() -> long;
static auto GetTextScrollSpeed() -> 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_default_music{INI_SECTION, "default_music", "/config/sphaira/themes/default_music.bfstm"};
option::OptionString m_theme_path{INI_SECTION, "theme", DEFAULT_THEME_PATH}; option::OptionString m_theme_path{INI_SECTION, "theme", DEFAULT_THEME_PATH};
option::OptionBool m_theme_music{INI_SECTION, "theme_music", true}; 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::OptionLong m_language{INI_SECTION, "language", 0}; // auto
option::OptionString m_left_menu{INI_SECTION, "left_side_menu", "FileBrowser"}; option::OptionString m_left_menu{INI_SECTION, "left_side_menu", "FileBrowser"};
option::OptionString m_right_menu{INI_SECTION, "right_side_menu", "Appstore"}; option::OptionString m_right_menu{INI_SECTION, "right_side_menu", "Appstore"};

View File

@@ -752,10 +752,6 @@ auto App::GetTextScrollSpeed() -> long {
return g_app->m_text_scroll_speed.Get(); return g_app->m_text_scroll_speed.Get();
} }
auto App::Get12HourTimeEnable() -> bool {
return g_app->m_12hour_time.Get();
}
auto App::GetNszCompressLevel() -> u8 { auto App::GetNszCompressLevel() -> u8 {
return NSZ_COMPRESS_LEVEL_OPTIONS[App::GetApp()->m_nsz_compress_level.Get()].value; 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) { void App::SetMtpEnable(bool enable) {
if (App::GetMtpEnable() != enable) { if (App::GetMtpEnable() != enable) {
g_app->m_mtp_enabled.Set(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_default_music.LoadFrom(Key, Value)) {}
else if (app->m_theme_path.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_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_language.LoadFrom(Key, Value)) {}
else if (app->m_left_menu.LoadFrom(Key, Value)) {} else if (app->m_left_menu.LoadFrom(Key, Value)) {}
else if (app->m_right_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. " "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); "If a theme does not set a music file, the default music is loaded instead (if it exists)."_i18n);
options->Add<ui::SidebarEntryBool>("12 Hour Time"_i18n, App::Get12HourTimeEnable(), [](bool& enable){ options->Add<ui::SidebarEntryBool>("Show IP address"_i18n, App::GetApp()->m_show_ip_addr,
App::Set12HourTimeEnable(enable); "Shows the IP address in all menus, including the WiFi strength.\n\n"
}, "Changes the clock to 12 hour"_i18n); "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 file picker for music here.
// todo: add array to audio which has the list of supported extensions. // todo: add array to audio which has the list of supported extensions.

View File

@@ -111,7 +111,7 @@ void MenuBase::Draw(NVGcontext* vg, Theme* theme) {
// ran out of space, its one or the other. // ran out of space, its one or the other.
if (!App::IsApplication()) { if (!App::IsApplication()) {
draw(ThemeEntryID_ERROR, 0, ("[Applet Mode]"_i18n).c_str()); draw(ThemeEntryID_ERROR, 0, ("[Applet Mode]"_i18n).c_str());
} else { } else if (App::GetApp()->m_show_ip_addr.Get()) {
if (pdata.ip) { if (pdata.ip) {
char ip_buf[32]; 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); 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);