Reset settings on button hold

extend this properly to the gigabeast and iriver
updated manual entries

Change-Id: Ibd1bce8d113193cb3b76f4daf0d6ceb01a2f7585
This commit is contained in:
William Wilgus 2022-06-20 22:37:09 -04:00 committed by William Wilgus
parent e75e07e1b6
commit 8283752223
7 changed files with 64 additions and 25 deletions

View file

@ -290,7 +290,8 @@ multi_boot
hibylinux
#endif
#if defined(SETTINGS_RESET) || \
#if defined(BUTTON_REC) || \
(CONFIG_KEYPAD == GIGABEAT_PAD) || \
(CONFIG_KEYPAD == IPOD_4G_PAD) || \
(CONFIG_KEYPAD == IRIVER_H10_PAD)
clear_settings_on_hold

View file

@ -16374,14 +16374,21 @@
user: core
<source>
*: none
clear_settings_on_hold, ipod4g, iriverh10: "Clear settings when hold switch is on during startup"
ipod3g: none
ipod*: "Clear settings when hold switch is on during startup"
clear_settings_on_hold, iriverh10: "Clear settings when reset button is held during startup"
</source>
<dest>
*: none
clear_settings_on_hold, ipod4g, iriverh10: "Clear settings when hold switch is on during startup"
ipod3g: none
ipod*: "Clear settings when hold switch is on during startup"
clear_settings_on_hold, iriverh10: "Clear settings when reset button is held during startup"
</dest>
<voice>
*: none
clear_settings_on_hold, ipod4g, iriverh10: "Clear settings when hold switch is on during startup"
ipod3g: none
ipod*: "Clear settings when hold switch is on during startup"
clear_settings_on_hold, iriverh10: "Clear settings when reset button is held during startup"
</voice>
</phrase>

View file

@ -570,16 +570,18 @@ static void init(void)
settings_load(SETTINGS_ALL);
CHART("<settings_load(ALL)");
#if defined(SETTINGS_RESET) || \
#if defined(BUTTON_REC) || \
(CONFIG_KEYPAD == GIGABEAT_PAD) || \
(CONFIG_KEYPAD == IPOD_4G_PAD) || \
(CONFIG_KEYPAD == IRIVER_H10_PAD)
if (global_settings.clear_settings_on_hold &&
#ifdef SETTINGS_RESET
/* Reset settings if holding the reset button. (Rec on Archos,
A on Gigabeat) */
if ((button_status() & SETTINGS_RESET) == SETTINGS_RESET)
((button_status() & SETTINGS_RESET) == SETTINGS_RESET))
#else
/* Reset settings if the hold button is turned on */
if (global_settings.clear_settings_on_hold && button_hold())
(button_hold()))
#endif
{
splash(HZ*2, str(LANG_RESET_DONE_CLEAR));

View file

@ -584,9 +584,10 @@ MENUITEM_SETTING(keypress_restarts_sleeptimer,
&global_settings.keypress_restarts_sleeptimer, NULL);
MENUITEM_SETTING(show_shutdown_message, &global_settings.show_shutdown_message, NULL);
#if defined(SETTINGS_RESET) || \
(CONFIG_KEYPAD == IPOD_4G_PAD) || \
(CONFIG_KEYPAD == IRIVER_H10_PAD)
#if defined(BUTTON_REC) || \
(CONFIG_KEYPAD == GIGABEAT_PAD) || \
(CONFIG_KEYPAD == IPOD_4G_PAD) || \
(CONFIG_KEYPAD == IRIVER_H10_PAD)
#define SETTINGS_CLEAR_ON_HOLD
MENUITEM_SETTING(clear_settings_on_hold,
&global_settings.clear_settings_on_hold, NULL);

View file

@ -868,9 +868,10 @@ struct user_settings
#if defined(DX50) || defined(DX90) || (defined(HAVE_USB_POWER) && !defined(USB_NONE) && !defined(SIMULATOR))
int usb_mode;
#endif
#if defined(SETTINGS_RESET) || \
(CONFIG_KEYPAD == IPOD_4G_PAD) || \
(CONFIG_KEYPAD == IRIVER_H10_PAD)
#if defined(BUTTON_REC) || \
(CONFIG_KEYPAD == GIGABEAT_PAD) || \
(CONFIG_KEYPAD == IPOD_4G_PAD) || \
(CONFIG_KEYPAD == IRIVER_H10_PAD)
bool clear_settings_on_hold;
#endif
};

View file

@ -2167,9 +2167,10 @@ const struct settings_list settings[] = {
#endif
),
#endif
#if defined(SETTINGS_RESET) || \
(CONFIG_KEYPAD == IPOD_4G_PAD) || \
(CONFIG_KEYPAD == IRIVER_H10_PAD)
#if defined(BUTTON_REC) || \
(CONFIG_KEYPAD == GIGABEAT_PAD) || \
(CONFIG_KEYPAD == IPOD_4G_PAD) || \
(CONFIG_KEYPAD == IRIVER_H10_PAD)
OFFON_SETTING(0, clear_settings_on_hold, LANG_CLEAR_SETTINGS_ON_HOLD,
true, "clear settings on hold", NULL),
#endif

View file

@ -37,16 +37,42 @@ are run at startup, or initiate a shutdown when conditions are met.
\end{description}
\opt{clear_settings_on_hold}{
\subsection{\label{ref:ClearOnHold}Hold switch clears settings on startup }
This option controls whether Rockbox clears its configuration if the hold
switch is enabled during startup.
\opt{ipod}{
\subsection{\label{ref:ClearOnHold}Hold switch clears settings on startup }
This option controls whether Rockbox clears its configuration if the hold
switch is enabled during startup.
\begin{description}
\item[Yes.]
Clear the settings if the hold switch is enabled during startup.
\item[No.]
Do not clear the settings, regardless of the hold switch's position.
\end{description}
\begin{description}
\item[Yes.]
Clear the settings if the hold switch is enabled during startup.
\item[No.]
Do not clear the settings, regardless of the hold switch's position.
\end{description}
}
\nopt{ipod}{
\opt{GIGABEAT_S_PAD}{
\subsection{\label{ref:ClearOnHold}BUTTON A clears settings on startup }
This option controls whether Rockbox clears its configuration if BUTTON_A
is held during startup.
\begin{description}
\item[Yes.]
Clear the settings if the BUTTON A is held.
\item[No.]
Do not clear the settings, regardless of BUTTON A.
\end{description}
}
\nopt{GIGABEAT_S_PAD}{
\subsection{\label{ref:ClearOnHold}BUTTON REC clears settings on startup }
This option controls whether Rockbox clears its configuration if BUTTON REC
is held during startup.
\begin{description}
\item[Yes.]
Clear the settings if the BUTTON REC is held.
\item[No.]
Do not clear the settings, regardless of BUTTON REC.
\end{description}
}
}
}
\subsection{\label{ref:IdlePoweroffSetting}Idle Poweroff}