diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-07-24 21:26:41 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-07-24 21:26:41 +0000 |
commit | 5b5003dcb12b0fe22f497a62d3024f3cf7a10fd1 (patch) | |
tree | effe16b48cdae25b0776df1d0ef87f73c36c5267 /apps/screens.c | |
parent | 6b8d020876f97a4af01d628ad0de251b103be01c (diff) | |
download | rockbox-5b5003dcb12b0fe22f497a62d3024f3cf7a10fd1.tar.gz rockbox-5b5003dcb12b0fe22f497a62d3024f3cf7a10fd1.zip |
New feature: clean shutdown if you press OFF twice in the file browser, or select "Shut
off" in the main menu. Players only have the menu option, due to lack of keys.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4940 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/screens.c')
-rw-r--r-- | apps/screens.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/apps/screens.c b/apps/screens.c index 28d9a48869..c099822525 100644 --- a/apps/screens.c +++ b/apps/screens.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include "adc.h" | 39 | #include "adc.h" |
40 | #include "action.h" | 40 | #include "action.h" |
41 | #include "talk.h" | 41 | #include "talk.h" |
42 | #include "misc.h" | ||
42 | 43 | ||
43 | #ifdef HAVE_LCD_BITMAP | 44 | #ifdef HAVE_LCD_BITMAP |
44 | #define BMPHEIGHT_usb_logo 32 | 45 | #define BMPHEIGHT_usb_logo 32 |
@@ -1090,3 +1091,41 @@ bool set_time_screen(char* string, struct tm *tm) | |||
1090 | return false; | 1091 | return false; |
1091 | } | 1092 | } |
1092 | #endif | 1093 | #endif |
1094 | |||
1095 | bool shutdown_screen(void) | ||
1096 | { | ||
1097 | int button; | ||
1098 | bool done = false; | ||
1099 | |||
1100 | lcd_stop_scroll(); | ||
1101 | |||
1102 | #ifdef HAVE_LCD_CHARCELLS | ||
1103 | splash(0, true, "Push STOP to shut off"); | ||
1104 | #else | ||
1105 | splash(0, true, "Push OFF to shut off"); | ||
1106 | #endif | ||
1107 | while(!done) | ||
1108 | { | ||
1109 | button = button_get_w_tmo(HZ*2); | ||
1110 | switch(button) | ||
1111 | { | ||
1112 | #ifdef HAVE_PLAYER_KEYPAD | ||
1113 | case BUTTON_STOP: | ||
1114 | #else | ||
1115 | case BUTTON_OFF: | ||
1116 | #endif | ||
1117 | clean_shutdown(); | ||
1118 | break; | ||
1119 | |||
1120 | default: | ||
1121 | /* Return if any other button was pushed, or if there | ||
1122 | was a timeout. We ignore RELEASE events, since we may | ||
1123 | have been called by a button down event, and the user might | ||
1124 | not have released the button yet. */ | ||
1125 | if(!(button & BUTTON_REL)) | ||
1126 | done = true; | ||
1127 | break; | ||
1128 | } | ||
1129 | } | ||
1130 | return false; | ||
1131 | } | ||