forked from len0rd/rockbox
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
This commit is contained in:
parent
dc1fc3c51b
commit
a74eefe1b2
2 changed files with 18 additions and 17 deletions
|
|
@ -675,6 +675,8 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
|
||||||
{
|
{
|
||||||
if (menu != &root_menu_)
|
if (menu != &root_menu_)
|
||||||
ret = GO_TO_ROOT;
|
ret = GO_TO_ROOT;
|
||||||
|
else
|
||||||
|
ret = GO_TO_PREVIOUS;
|
||||||
}
|
}
|
||||||
else if (action == ACTION_STD_CANCEL)
|
else if (action == ACTION_STD_CANCEL)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -342,40 +342,39 @@ void root_menu(void)
|
||||||
check_boot();
|
check_boot();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else if (ret_val <= GO_TO_ROOT)
|
||||||
if (ret_val == GO_TO_PREVIOUS_MUSIC)
|
continue;
|
||||||
ret_val = previous_music;
|
|
||||||
last_screen = GO_TO_ROOT;
|
last_screen = GO_TO_ROOT;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GO_TO_PREVIOUS:
|
case GO_TO_PREVIOUS:
|
||||||
ret_val = last_screen;
|
ret_val = last_screen;
|
||||||
if (last_screen == GO_TO_ROOT)
|
continue;
|
||||||
continue;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GO_TO_PREVIOUS_BROWSER:
|
case GO_TO_PREVIOUS_BROWSER:
|
||||||
if ((previous_browser == GO_TO_DBBROWSER) &&
|
if ((previous_browser == GO_TO_DBBROWSER) &&
|
||||||
!tagcache_is_usable())
|
!tagcache_is_usable())
|
||||||
ret_val = GO_TO_FILEBROWSER;
|
ret_val = GO_TO_FILEBROWSER;
|
||||||
else
|
else
|
||||||
ret_val = previous_browser;
|
ret_val = previous_browser;
|
||||||
|
/* fall through */
|
||||||
|
case GO_TO_FILEBROWSER:
|
||||||
|
case GO_TO_DBBROWSER:
|
||||||
|
previous_browser = ret_val;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GO_TO_PREVIOUS_MUSIC:
|
case GO_TO_PREVIOUS_MUSIC:
|
||||||
ret_val = 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;
|
break;
|
||||||
}
|
}
|
||||||
this_screen = ret_val;
|
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,
|
/* set the global_status.last_screen before entering,
|
||||||
if we dont we will always return to the wrong screen on boot */
|
if we dont we will always return to the wrong screen on boot */
|
||||||
global_status.last_screen = (char)this_screen;
|
global_status.last_screen = (char)this_screen;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue