mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
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
This commit is contained in:
parent
5433ea5405
commit
7e0e4fe888
8 changed files with 41 additions and 2 deletions
|
@ -16136,3 +16136,17 @@
|
||||||
*: "List Wraparound"
|
*: "List Wraparound"
|
||||||
</voice>
|
</voice>
|
||||||
</phrase>
|
</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>
|
|
@ -563,9 +563,11 @@ MENUITEM_SETTING(sleeptimer_on_startup,
|
||||||
&global_settings.sleeptimer_on_startup, NULL);
|
&global_settings.sleeptimer_on_startup, NULL);
|
||||||
MENUITEM_SETTING(keypress_restarts_sleeptimer,
|
MENUITEM_SETTING(keypress_restarts_sleeptimer,
|
||||||
&global_settings.keypress_restarts_sleeptimer, NULL);
|
&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),
|
MAKE_MENU(startup_shutdown_menu, ID2P(LANG_STARTUP_SHUTDOWN),
|
||||||
0, Icon_System_menu,
|
0, Icon_System_menu,
|
||||||
|
&show_shutdown_message,
|
||||||
&start_screen,
|
&start_screen,
|
||||||
&poweroff,
|
&poweroff,
|
||||||
&sleeptimer_toggle,
|
&sleeptimer_toggle,
|
||||||
|
|
|
@ -323,7 +323,10 @@ static bool clean_shutdown(void (*callback)(void *), void *parameter)
|
||||||
#endif
|
#endif
|
||||||
level = battery_level();
|
level = battery_level();
|
||||||
if (level > 10 || level < 0)
|
if (level > 10 || level < 0)
|
||||||
splash(0, str(LANG_SHUTTINGDOWN));
|
{
|
||||||
|
if (global_settings.show_shutdown_message)
|
||||||
|
splash(0, str(LANG_SHUTTINGDOWN));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
msg_id = LANG_WARNING_BATTERY_LOW;
|
msg_id = LANG_WARNING_BATTERY_LOW;
|
||||||
|
|
|
@ -761,6 +761,9 @@ struct user_settings
|
||||||
bool sleeptimer_on_startup;
|
bool sleeptimer_on_startup;
|
||||||
bool keypress_restarts_sleeptimer;
|
bool keypress_restarts_sleeptimer;
|
||||||
|
|
||||||
|
bool show_shutdown_message; /* toggle whether display lights up and displays message
|
||||||
|
when shutting down */
|
||||||
|
|
||||||
#ifdef HAVE_MORSE_INPUT
|
#ifdef HAVE_MORSE_INPUT
|
||||||
bool morse_input; /* text input method setting */
|
bool morse_input; /* text input method setting */
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1956,6 +1956,10 @@ const struct settings_list settings[] = {
|
||||||
"sleeptimer on startup", NULL),
|
"sleeptimer on startup", NULL),
|
||||||
OFFON_SETTING(0, keypress_restarts_sleeptimer, LANG_KEYPRESS_RESTARTS_SLEEP_TIMER, false,
|
OFFON_SETTING(0, keypress_restarts_sleeptimer, LANG_KEYPRESS_RESTARTS_SLEEP_TIMER, false,
|
||||||
"keypress restarts sleeptimer", set_keypress_restarts_sleep_timer),
|
"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
|
#ifdef HAVE_TOUCHPAD_SENSITIVITY_SETTING
|
||||||
/* If specific values are set for touchpad sensitivity setting we use those */
|
/* If specific values are set for touchpad sensitivity setting we use those */
|
||||||
#if (defined(MAX_TOUCHPAD_SENSITIVITY_SETTING) \
|
#if (defined(MAX_TOUCHPAD_SENSITIVITY_SETTING) \
|
||||||
|
|
|
@ -21,6 +21,9 @@
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#if !defined(BOOTLOADER)
|
||||||
|
#include "settings.h"
|
||||||
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "kernel.h"
|
#include "kernel.h"
|
||||||
|
@ -667,7 +670,11 @@ void backlight_thread(void)
|
||||||
|
|
||||||
case SYS_POWEROFF: /* Lock backlight on poweroff so it doesn't */
|
case SYS_POWEROFF: /* Lock backlight on poweroff so it doesn't */
|
||||||
locked = true; /* go off before power is actually cut. */
|
locked = true; /* go off before power is actually cut. */
|
||||||
/* fall through */
|
#if !defined(BOOTLOADER)
|
||||||
|
if (!global_settings.show_shutdown_message)
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
/* else fall through */
|
||||||
#if CONFIG_CHARGING
|
#if CONFIG_CHARGING
|
||||||
case SYS_CHARGER_CONNECTED:
|
case SYS_CHARGER_CONNECTED:
|
||||||
case SYS_CHARGER_DISCONNECTED:
|
case SYS_CHARGER_DISCONNECTED:
|
||||||
|
|
|
@ -107,6 +107,7 @@
|
||||||
|
|
||||||
idle poweroff & off, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 30, 45, 60
|
idle poweroff & off, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 30, 45, 60
|
||||||
& min\\
|
& min\\
|
||||||
|
show shutdown message & off, on & N/A\\
|
||||||
sleeptimer duration & 5 to 300 (in steps of 5)
|
sleeptimer duration & 5 to 300 (in steps of 5)
|
||||||
& min\\
|
& min\\
|
||||||
sleeptimer on startup & off, on & N/A\\
|
sleeptimer on startup & off, on & N/A\\
|
||||||
|
|
|
@ -5,6 +5,11 @@
|
||||||
The \setting{Startup/Shutdown} sub menu allows you to configure items which
|
The \setting{Startup/Shutdown} sub menu allows you to configure items which
|
||||||
are run at startup, or initiate a shutdown when conditions are met.
|
are run at startup, or initiate a shutdown when conditions are met.
|
||||||
|
|
||||||
|
\begin{description}
|
||||||
|
\item[Show Shutdown Message.] If set, a message will be displayed and the display
|
||||||
|
will light up before the device shuts down.
|
||||||
|
\end{description}
|
||||||
|
|
||||||
\subsection{Start Screen}
|
\subsection{Start Screen}
|
||||||
Set the screen that Rockbox will start in. The default is the main menu but
|
Set the screen that Rockbox will start in. The default is the main menu but
|
||||||
the following options are available:
|
the following options are available:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue