diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-06 13:35:15 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-06 13:35:15 +0000 |
| commit | a74eefe1b21e3a20bd15ccb7663dcb63ac475b39 (patch) | |
| tree | a12f8a8d84278335133ad0ee3e2b9ca0ae15b59a /apps/root_menu.c | |
| parent | dc1fc3c51bf29cd36b71674aeb9319eefeed2376 (diff) | |
| download | rockbox-a74eefe1b21e3a20bd15ccb7663dcb63ac475b39.zip rockbox-a74eefe1b21e3a20bd15ccb7663dcb63ac475b39.tar.gz rockbox-a74eefe1b21e3a20bd15ccb7663dcb63ac475b39.tar.bz2 rockbox-a74eefe1b21e3a20bd15ccb7663dcb63ac475b39.tar.xz | |
Pressing Menu in the Rockbox Menu puts you back in the previous screen.
Hopefully simplify the code a bit
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12643 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/root_menu.c')
| -rw-r--r-- | apps/root_menu.c | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c index f30e10c..b797d47 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c @@ -342,40 +342,39 @@ void root_menu(void) check_boot(); continue; } - - if (ret_val == GO_TO_PREVIOUS_MUSIC) - ret_val = previous_music; + else if (ret_val <= GO_TO_ROOT) + continue; last_screen = GO_TO_ROOT; break; + case GO_TO_PREVIOUS: ret_val = last_screen; - if (last_screen == GO_TO_ROOT) - continue; + continue; break; + case GO_TO_PREVIOUS_BROWSER: if ((previous_browser == GO_TO_DBBROWSER) && !tagcache_is_usable()) ret_val = GO_TO_FILEBROWSER; else ret_val = previous_browser; + /* fall through */ + case GO_TO_FILEBROWSER: + case GO_TO_DBBROWSER: + previous_browser = ret_val; break; + case GO_TO_PREVIOUS_MUSIC: ret_val = previous_music; + /* fall through */ + case GO_TO_WPS: +#if CONFIG_TUNER + case GO_TO_FM: +#endif + previous_music = ret_val; break; } this_screen = ret_val; - - if (this_screen == GO_TO_FILEBROWSER) - previous_browser = GO_TO_FILEBROWSER; - else if (this_screen == GO_TO_DBBROWSER) - previous_browser = GO_TO_DBBROWSER; - else if (this_screen == GO_TO_WPS) - previous_music = GO_TO_WPS; -#if CONFIG_TUNER - else if (this_screen == GO_TO_FM) - previous_music = GO_TO_FM; -#endif - /* set the global_status.last_screen before entering, if we dont we will always return to the wrong screen on boot */ global_status.last_screen = (char)this_screen; |