summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-09-23 11:42:48 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-09-23 11:42:48 +0000
commit083a6dbc4eebbc0d74cbf44c661008e14c744070 (patch)
treef903da302094edca2fe20eeb86785cae6b4c4754 /apps
parent040e80c3ad00ee9b100f97d510a0acd37489cb9b (diff)
downloadrockbox-083a6dbc4eebbc0d74cbf44c661008e14c744070.tar.gz
rockbox-083a6dbc4eebbc0d74cbf44c661008e14c744070.tar.bz2
rockbox-083a6dbc4eebbc0d74cbf44c661008e14c744070.zip
Auto-poweroff, by Lee Marlow
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2374 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/lang/english.lang5
-rw-r--r--apps/settings.h2
-rw-r--r--apps/settings_menu.c14
3 files changed, 19 insertions, 2 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index 7962b55065..6402f8cddf 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -781,3 +781,8 @@ id: LANG_TETRIS_LEVEL
desc: tetris game
eng: "0 Rows - Level 0"
new:
+
+id: LANG_POWEROFF_IDLE
+desc: in settings_menu
+eng: "Idle Poweroff"
+new:
diff --git a/apps/settings.h b/apps/settings.h
index d03a5f688e..374b6e476c 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -62,7 +62,7 @@ struct user_settings
/* device settings */
int contrast; /* lcd contrast: 0-100 0=low 100=high */
- int poweroff; /* power off timer: 0-100 0=never:each 1% = 60 secs */
+ int poweroff; /* power off timer */
int backlight; /* backlight off timer: 0-100 0=never:each 1% = 10 secs */
bool discharge; /* maintain charge of at least: false = 90%, true = 10% */
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index 5ad7a1e79c..1e7f2f7808 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -99,6 +99,17 @@ static Menu backlight_timer(void)
return MENU_OK;
}
+static Menu poweroff_idle_timer(void)
+{
+ char* names[] = { str(LANG_OFF),
+ "1m ", "2m ", "3m ", "4m ", "5m ",
+ "6m ", "7m ", "8m ", "9m ", "10m",
+ "15m", "30m", "45m", "60m"};
+ set_option(str(LANG_POWEROFF_IDLE), &global_settings.poweroff, names,
+ 15, set_poweroff_timeout);
+ return MENU_OK;
+}
+
static Menu scroll_speed(void)
{
set_int(str(LANG_SCROLL), "", &global_settings.scroll_speed,
@@ -337,7 +348,8 @@ static Menu system_settings_menu(void)
#ifdef HAVE_LCD_BITMAP
{ str(LANG_TIME), timedate_set },
#endif
- { str(LANG_RESET), reset_settings },
+ { str(LANG_POWEROFF_IDLE), poweroff_idle_timer },
+ { str(LANG_RESET), reset_settings },
};
m=menu_init( items, sizeof items / sizeof(struct menu_items) );