summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2021-10-21 23:36:09 +0200
committerWilliam Wilgus <me.theuser@yahoo.com>2021-12-08 22:26:38 -0500
commit7e0e4fe888eba8133a753bb2abc748b0c404e9f5 (patch)
tree81bb6a5aecb8a2dee19ff03bd649010d7da87d27 /apps
parent5433ea540555f18d3986c5067c6f26ddf497bd9b (diff)
downloadrockbox-7e0e4fe888eba8133a753bb2abc748b0c404e9f5.tar.gz
rockbox-7e0e4fe888eba8133a753bb2abc748b0c404e9f5.zip
Add setting to hide shutdown message
Also keeps display from lighting up before shutdown, which reduces distractions, especially at night and when the sleep timer is used by allowing the screen to remain dark. Change-Id: I1c2d1966f6fb9766532adf01e8828876a871857f
Diffstat (limited to 'apps')
-rw-r--r--apps/lang/english.lang14
-rw-r--r--apps/menus/settings_menu.c2
-rw-r--r--apps/misc.c5
-rw-r--r--apps/settings.h3
-rw-r--r--apps/settings_list.c4
5 files changed, 27 insertions, 1 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 50cec84b7c..333527c71c 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -16136,3 +16136,17 @@
*: "List Wraparound"
</voice>
</phrase>
+<phrase>
+ id: LANG_SHOW_SHUTDOWN_MESSAGE
+ desc: in Settings
+ user: core
+ <source>
+ *: "Show Shutdown Message"
+ </source>
+ <dest>
+ *: "Show Shutdown Message"
+ </dest>
+ <voice>
+ *: "Show Shutdown Message"
+ </voice>
+</phrase> \ No newline at end of file
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 1dce12907f..562a89e85a 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -563,9 +563,11 @@ MENUITEM_SETTING(sleeptimer_on_startup,
&global_settings.sleeptimer_on_startup, NULL);
MENUITEM_SETTING(keypress_restarts_sleeptimer,
&global_settings.keypress_restarts_sleeptimer, NULL);
+MENUITEM_SETTING(show_shutdown_message, &global_settings.show_shutdown_message, NULL);
MAKE_MENU(startup_shutdown_menu, ID2P(LANG_STARTUP_SHUTDOWN),
0, Icon_System_menu,
+ &show_shutdown_message,
&start_screen,
&poweroff,
&sleeptimer_toggle,
diff --git a/apps/misc.c b/apps/misc.c
index 7da86930ba..2668ba714d 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -323,7 +323,10 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
#endif
level = battery_level();
if (level > 10 || level < 0)
- splash(0, str(LANG_SHUTTINGDOWN));
+ {
+ if (global_settings.show_shutdown_message)
+ splash(0, str(LANG_SHUTTINGDOWN));
+ }
else
{
msg_id = LANG_WARNING_BATTERY_LOW;
diff --git a/apps/settings.h b/apps/settings.h
index ce7421d95e..4374cc720b 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -761,6 +761,9 @@ struct user_settings
bool sleeptimer_on_startup;
bool keypress_restarts_sleeptimer;
+ bool show_shutdown_message; /* toggle whether display lights up and displays message
+ when shutting down */
+
#ifdef HAVE_MORSE_INPUT
bool morse_input; /* text input method setting */
#endif
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 383ec9cd0e..d8702148ba 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -1956,6 +1956,10 @@ const struct settings_list settings[] = {
"sleeptimer on startup", NULL),
OFFON_SETTING(0, keypress_restarts_sleeptimer, LANG_KEYPRESS_RESTARTS_SLEEP_TIMER, false,
"keypress restarts sleeptimer", set_keypress_restarts_sleep_timer),
+
+ OFFON_SETTING(0, show_shutdown_message, LANG_SHOW_SHUTDOWN_MESSAGE, true,
+ "show shutdown message", NULL),
+
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
/* If specific values are set for touchpad sensitivity setting we use those */
#if (defined(MAX_TOUCHPAD_SENSITIVITY_SETTING) \