diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-12-04 00:08:25 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-12-04 00:08:25 +0000 |
commit | 461d6e347e5d9c31a67454e9d87867ff105cf745 (patch) | |
tree | c2aa601b0e4cd65ed3be90583acc9c85d792fdc6 | |
parent | 34a4111adeb00c5bd806c54622c14a2b80d05226 (diff) |
Added a splash to indicate battery charging if user tries to shut off while plugged in.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4104 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/menu.c | 2 | ||||
-rw-r--r-- | apps/screens.c | 11 | ||||
-rw-r--r-- | apps/screens.h | 1 | ||||
-rw-r--r-- | apps/tree.c | 15 |
4 files changed, 28 insertions, 1 deletions
diff --git a/apps/menu.c b/apps/menu.c index 6589ec7be5..f317403f0d 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -316,9 +316,11 @@ int menu_show(int m) #ifdef HAVE_RECORDER_KEYPAD case BUTTON_LEFT: case BUTTON_F1: + case BUTTON_OFF | BUTTON_REPEAT: #else case BUTTON_STOP: case BUTTON_MENU: + case BUTTON_STOP | BUTTON_REPEAT: #endif lcd_stop_scroll(); exit = true; diff --git a/apps/screens.c b/apps/screens.c index 32e6936d7b..319c0eabd1 100644 --- a/apps/screens.c +++ b/apps/screens.c @@ -540,6 +540,9 @@ bool f2_screen(void) used = true; break; + case BUTTON_OFF | BUTTON_REPEAT: + return false; + case SYS_USB_CONNECTED: usb_screen(); return true; @@ -623,6 +626,9 @@ bool f3_screen(void) used = true; break; + case BUTTON_OFF | BUTTON_REPEAT: + return false; + case SYS_USB_CONNECTED: usb_screen(); return true; @@ -810,3 +816,8 @@ void splash(int ticks, /* how long */ } } +void charging_splash(void) +{ + splash(2*HZ, 0, true, str(LANG_BATTERY_CHARGE)); + while (button_get(false)); +} diff --git a/apps/screens.h b/apps/screens.h index 4a35d410f1..89bd3c39d8 100644 --- a/apps/screens.h +++ b/apps/screens.h @@ -22,6 +22,7 @@ void usb_display_info(void); void usb_screen(void); int charging_screen(void); +void charging_splash(void); #ifdef HAVE_RECORDER_KEYPAD int on_screen(void); diff --git a/apps/tree.c b/apps/tree.c index 6bd7b21c45..a71db78968 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -52,6 +52,7 @@ #include "onplay.h" #include "buffer.h" #include "plugin.h" +#include "power.h" #ifdef HAVE_LCD_BITMAP #include "widgets.h" @@ -885,7 +886,9 @@ static bool dirbrowse(char *root, int *dirfilter) switch ( button ) { case TREE_EXIT: case BUTTON_RC_STOP: - case TREE_EXIT | BUTTON_REPEAT: +#ifdef HAVE_RECORDER_KEYPAD + case BUTTON_LEFT | BUTTON_REPEAT: +#endif i=strlen(currdir); if (i>1) { while (currdir[i-1]!='/') @@ -928,6 +931,16 @@ static bool dirbrowse(char *root, int *dirfilter) settings_save(); break; +#ifdef HAVE_RECORDER_KEYPAD + case BUTTON_OFF | BUTTON_REPEAT: +#else + case BUTTON_STOP | BUTTON_REPEAT: +#endif + if (charger_inserted()) { + charging_splash(); + restore = true; + } + break; case TREE_ENTER: case TREE_ENTER | BUTTON_REPEAT: |