summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-11-04 12:10:41 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-11-04 12:10:41 +0000
commit62decc42e7f6752d786090277ac4b7f2d2036ad4 (patch)
tree765ec35a93063dfd7503430ee30ec6f631978c9e
parent4ada9ed2d9f4e1161ed2a9f8937d1e42e90d23df (diff)
downloadrockbox-62decc42e7f6752d786090277ac4b7f2d2036ad4.zip
rockbox-62decc42e7f6752d786090277ac4b7f2d2036ad4.tar.gz
rockbox-62decc42e7f6752d786090277ac4b7f2d2036ad4.tar.bz2
rockbox-62decc42e7f6752d786090277ac4b7f2d2036ad4.tar.xz
return to the main menu if stop is pressed in the wps context menu, (blame pondlife for the hack :D )
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15457 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/menu.c12
-rw-r--r--apps/onplay.c2
2 files changed, 13 insertions, 1 deletions
diff --git a/apps/menu.c b/apps/menu.c
index 35b2527..f9a2f3c 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -291,6 +291,12 @@ bool do_setting_from_menu(const struct menu_item_ex *temp)
return false;
}
+/* HACK ALERT: this is needed so pressing stop in the wps context menu returns to
+ the main menu as it is expected. otherwise there can be nasty side-effects
+ if any of the items are selected. */
+extern const struct menu_item_ex wps_onplay_menu;
+
+/* display a menu */
int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
{
int selected = start_selected? *start_selected : 0;
@@ -369,6 +375,12 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected)
else if (action == ACTION_TREE_STOP)
{
redraw_lists = list_stop_handler();
+ /*return to the main menu if stop is pressed in the WPS context menu */
+ if (menu == &wps_onplay_menu)
+ {
+ ret = GO_TO_ROOT;
+ done = true;
+ }
}
else if (action == ACTION_STD_CONTEXT &&
menu == &root_menu_)
diff --git a/apps/onplay.c b/apps/onplay.c
index a4da371..d4c5579 100644
--- a/apps/onplay.c
+++ b/apps/onplay.c
@@ -81,7 +81,7 @@ static bool clipboard_is_copy = false;
#define MAKE_ONPLAYMENU( name, str, callback, icon, ... ) \
static const struct menu_item_ex *name##_[] = {__VA_ARGS__}; \
static const struct menu_callback_with_desc name##__ = {callback,str,icon};\
- static const struct menu_item_ex name = \
+ const struct menu_item_ex name = \
{MT_MENU|MENU_HAS_DESC|MENU_EXITAFTERTHISMENU| \
MENU_ITEM_COUNT(sizeof( name##_)/sizeof(*name##_)), \
{ (void*)name##_},{.callback_and_desc = & name##__}};