summaryrefslogtreecommitdiff
path: root/apps/root_menu.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-01-29 01:01:12 +0000
committerThomas Martitz <kugel@rockbox.org>2011-01-29 01:01:12 +0000
commit89a4cf26933a1c82e4da8f4a382ed9b80f43956e (patch)
tree52957ee5ecc0351b556e818c9a67da440215ed31 /apps/root_menu.c
parent3f709eada2d67418971ec1c5d907a06ba9161200 (diff)
downloadrockbox-89a4cf26933a1c82e4da8f4a382ed9b80f43956e.tar.gz
rockbox-89a4cf26933a1c82e4da8f4a382ed9b80f43956e.zip
Change the way how playlists and system menu items in the main menu are internally invoked so that the mechanism to
pass the back button press to the android system (to let it go to the home screen) works for them. This fixes that the back button goes still to the home screen after entering these items. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29157 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/root_menu.c')
-rw-r--r--apps/root_menu.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 27242c9797..4dca1f3541 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -271,14 +271,8 @@ static int browser(void* param)
271#endif 271#endif
272 } 272 }
273 return ret_val; 273 return ret_val;
274}
275
276static int menu(void* param)
277{
278 (void)param;
279 return do_menu(NULL, 0, NULL, false);
280
281} 274}
275
282#ifdef HAVE_RECORDING 276#ifdef HAVE_RECORDING
283static int recscrn(void* param) 277static int recscrn(void* param)
284{ 278{
@@ -323,6 +317,18 @@ static int radio(void* param)
323} 317}
324#endif 318#endif
325 319
320static int miscscrn(void * param)
321{
322 const struct menu_item_ex *menu = (const struct menu_item_ex*)param;
323 switch (do_menu(menu, NULL, NULL, false))
324 {
325 case GO_TO_PLAYLIST_VIEWER:
326 return GO_TO_PLAYLIST_VIEWER;
327 default:
328 return GO_TO_ROOT;
329 }
330}
331
326static int playlist_view(void * param) 332static int playlist_view(void * param)
327{ 333{
328 (void)param; 334 (void)param;
@@ -391,10 +397,13 @@ extern struct menu_item_ex
391#ifdef HAVE_TAGCACHE 397#ifdef HAVE_TAGCACHE
392 tagcache_menu, 398 tagcache_menu,
393#endif 399#endif
400 main_menu_,
394 manage_settings, 401 manage_settings,
395 recording_settings_menu, 402 recording_settings_menu,
396 radio_settings_menu, 403 radio_settings_menu,
397 bookmark_settings_menu, 404 bookmark_settings_menu,
405 playlist_options,
406 info_menu,
398 system_menu; 407 system_menu;
399static const struct root_items items[] = { 408static const struct root_items items[] = {
400 [GO_TO_FILEBROWSER] = { browser, (void*)GO_TO_FILEBROWSER, &file_menu}, 409 [GO_TO_FILEBROWSER] = { browser, (void*)GO_TO_FILEBROWSER, &file_menu},
@@ -402,7 +411,8 @@ static const struct root_items items[] = {
402 [GO_TO_DBBROWSER] = { browser, (void*)GO_TO_DBBROWSER, &tagcache_menu }, 411 [GO_TO_DBBROWSER] = { browser, (void*)GO_TO_DBBROWSER, &tagcache_menu },
403#endif 412#endif
404 [GO_TO_WPS] = { wpsscrn, NULL, &playback_settings }, 413 [GO_TO_WPS] = { wpsscrn, NULL, &playback_settings },
405 [GO_TO_MAINMENU] = { menu, NULL, &manage_settings }, 414 [GO_TO_MAINMENU] = { miscscrn, (struct menu_item_ex*)&main_menu_,
415 &manage_settings },
406 416
407#ifdef HAVE_RECORDING 417#ifdef HAVE_RECORDING
408 [GO_TO_RECSCREEN] = { recscrn, NULL, &recording_settings_menu }, 418 [GO_TO_RECSCREEN] = { recscrn, NULL, &recording_settings_menu },
@@ -414,7 +424,9 @@ static const struct root_items items[] = {
414 424
415 [GO_TO_RECENTBMARKS] = { load_bmarks, NULL, &bookmark_settings_menu }, 425 [GO_TO_RECENTBMARKS] = { load_bmarks, NULL, &bookmark_settings_menu },
416 [GO_TO_BROWSEPLUGINS] = { plugins_menu, NULL, NULL }, 426 [GO_TO_BROWSEPLUGINS] = { plugins_menu, NULL, NULL },
427 [GO_TO_PLAYLISTS_SCREEN] = { miscscrn, &playlist_options, NULL },
417 [GO_TO_PLAYLIST_VIEWER] = { playlist_view, NULL, NULL }, 428 [GO_TO_PLAYLIST_VIEWER] = { playlist_view, NULL, NULL },
429 [GO_TO_SYSTEM_SCREEN] = { miscscrn, &info_menu, &system_menu },
418 430
419}; 431};
420static const int nb_items = sizeof(items)/sizeof(*items); 432static const int nb_items = sizeof(items)/sizeof(*items);
@@ -451,6 +463,11 @@ MENUITEM_RETURNVALUE(menu_, ID2P(LANG_SETTINGS), GO_TO_MAINMENU,
451MENUITEM_RETURNVALUE(bookmarks, ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS), 463MENUITEM_RETURNVALUE(bookmarks, ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS),
452 GO_TO_RECENTBMARKS, item_callback, 464 GO_TO_RECENTBMARKS, item_callback,
453 Icon_Bookmark); 465 Icon_Bookmark);
466MENUITEM_RETURNVALUE(playlists, ID2P(LANG_PLAYLISTS), GO_TO_PLAYLISTS_SCREEN,
467 NULL, Icon_Playlist);
468MENUITEM_RETURNVALUE(system_menu_, ID2P(LANG_SYSTEM), GO_TO_SYSTEM_SCREEN,
469 NULL, Icon_System_menu);
470
454#ifdef HAVE_LCD_CHARCELLS 471#ifdef HAVE_LCD_CHARCELLS
455static int do_shutdown(void) 472static int do_shutdown(void)
456{ 473{
@@ -478,7 +495,7 @@ MAKE_MENU(root_menu_, ID2P(LANG_ROCKBOX_TITLE),
478#if CONFIG_TUNER 495#if CONFIG_TUNER
479 &fm, 496 &fm,
480#endif 497#endif
481 &playlist_options, &rocks_browser, &info_menu 498 &playlists, &rocks_browser, &system_menu_
482 499
483#ifdef HAVE_LCD_CHARCELLS 500#ifdef HAVE_LCD_CHARCELLS
484 ,&do_shutdown_item 501 ,&do_shutdown_item