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
This commit is contained in:
parent
34a4111ade
commit
461d6e347e
4 changed files with 28 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
15
apps/tree.c
15
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:
|
||||
|
|
Loading…
Reference in a new issue