From 5b5003dcb12b0fe22f497a62d3024f3cf7a10fd1 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Sat, 24 Jul 2004 21:26:41 +0000 Subject: 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 --- apps/tree.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'apps/tree.c') diff --git a/apps/tree.c b/apps/tree.c index 754e84f508..1faadf69f7 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -1012,18 +1012,18 @@ static bool dirbrowse(char *root, int *dirfilter) break; #ifdef HAVE_RECORDER_KEYPAD - case BUTTON_OFF: - bookmark_autobookmark(); - mpeg_stop(); - status_draw(false); - restore = true; - break; - case BUTTON_OFF | BUTTON_REL: -#else - case BUTTON_STOP | BUTTON_REL: #endif - settings_save(); + /* Stop the music if it is playing, else show the shutdown + screen */ + if(mpeg_status()) + mpeg_stop(); + else { + if (!charger_inserted()) { + shutdown_screen(); + restore = true; + } + } break; #ifdef HAVE_RECORDER_KEYPAD -- cgit v1.2.3