diff options
author | Thomas Martitz <kugel@rockbox.org> | 2011-01-29 01:01:12 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2011-01-29 01:01:12 +0000 |
commit | 89a4cf26933a1c82e4da8f4a382ed9b80f43956e (patch) | |
tree | 52957ee5ecc0351b556e818c9a67da440215ed31 /apps | |
parent | 3f709eada2d67418971ec1c5d907a06ba9161200 (diff) | |
download | rockbox-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')
-rw-r--r-- | apps/menu.c | 5 | ||||
-rw-r--r-- | apps/menus/exported_menus.h | 3 | ||||
-rw-r--r-- | apps/root_menu.c | 35 | ||||
-rw-r--r-- | apps/root_menu.h | 2 |
4 files changed, 29 insertions, 16 deletions
diff --git a/apps/menu.c b/apps/menu.c index 5839a51c21..8ea2f0883e 100644 --- a/apps/menu.c +++ b/apps/menu.c | |||
@@ -327,7 +327,7 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, | |||
327 | int selected = start_selected? *start_selected : 0; | 327 | int selected = start_selected? *start_selected : 0; |
328 | int action; | 328 | int action; |
329 | struct gui_synclist lists; | 329 | struct gui_synclist lists; |
330 | const struct menu_item_ex *temp, *menu; | 330 | const struct menu_item_ex *temp, *menu = start_menu; |
331 | int ret = 0, i; | 331 | int ret = 0, i; |
332 | bool redraw_lists; | 332 | bool redraw_lists; |
333 | int old_audio_status = audio_status(); | 333 | int old_audio_status = audio_status(); |
@@ -347,9 +347,6 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, | |||
347 | #endif | 347 | #endif |
348 | 348 | ||
349 | menu_callback_type menu_callback = NULL; | 349 | menu_callback_type menu_callback = NULL; |
350 | if (start_menu == NULL) | ||
351 | menu = &main_menu_; | ||
352 | else menu = start_menu; | ||
353 | 350 | ||
354 | /* if hide_theme is true, assume parent has been fixed before passed into | 351 | /* if hide_theme is true, assume parent has been fixed before passed into |
355 | * this function, e.g. with viewport_set_defaults(parent, screen) */ | 352 | * this function, e.g. with viewport_set_defaults(parent, screen) */ |
diff --git a/apps/menus/exported_menus.h b/apps/menus/exported_menus.h index 37b5ff31d0..3d253e7dd9 100644 --- a/apps/menus/exported_menus.h +++ b/apps/menus/exported_menus.h | |||
@@ -26,7 +26,6 @@ | |||
26 | #ifndef PLUGIN | 26 | #ifndef PLUGIN |
27 | 27 | ||
28 | extern const struct menu_item_ex | 28 | extern const struct menu_item_ex |
29 | main_menu_, /* main_menu.c */ | ||
30 | display_menu, /* display_menu.c */ | 29 | display_menu, /* display_menu.c */ |
31 | playback_settings, /* playback_menu.c */ | 30 | playback_settings, /* playback_menu.c */ |
32 | #ifdef HAVE_RECORDING | 31 | #ifdef HAVE_RECORDING |
@@ -38,12 +37,10 @@ extern const struct menu_item_ex | |||
38 | sound_settings, /* sound_menu.c */ | 37 | sound_settings, /* sound_menu.c */ |
39 | settings_menu_item, /* settings_menu.c */ | 38 | settings_menu_item, /* settings_menu.c */ |
40 | playlist_settings, /* playlist_menu.c */ | 39 | playlist_settings, /* playlist_menu.c */ |
41 | playlist_options, /* playlist_menu.c */ | ||
42 | equalizer_menu, /* eq_menu.c */ | 40 | equalizer_menu, /* eq_menu.c */ |
43 | #ifdef AUDIOHW_HAVE_EQ | 41 | #ifdef AUDIOHW_HAVE_EQ |
44 | audiohw_eq_tone_controls, /* audiohw_eq_menu.c */ | 42 | audiohw_eq_tone_controls, /* audiohw_eq_menu.c */ |
45 | #endif | 43 | #endif |
46 | info_menu, /* info_menu.c */ | ||
47 | theme_menu; /* theme_menu.c */ | 44 | theme_menu; /* theme_menu.c */ |
48 | 45 | ||
49 | struct browse_folder_info { | 46 | struct browse_folder_info { |
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 | |||
276 | static 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 |
283 | static int recscrn(void* param) | 277 | static int recscrn(void* param) |
284 | { | 278 | { |
@@ -323,6 +317,18 @@ static int radio(void* param) | |||
323 | } | 317 | } |
324 | #endif | 318 | #endif |
325 | 319 | ||
320 | static 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 | |||
326 | static int playlist_view(void * param) | 332 | static 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; |
399 | static const struct root_items items[] = { | 408 | static 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 | }; |
420 | static const int nb_items = sizeof(items)/sizeof(*items); | 432 | static const int nb_items = sizeof(items)/sizeof(*items); |
@@ -451,6 +463,11 @@ MENUITEM_RETURNVALUE(menu_, ID2P(LANG_SETTINGS), GO_TO_MAINMENU, | |||
451 | MENUITEM_RETURNVALUE(bookmarks, ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS), | 463 | MENUITEM_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); |
466 | MENUITEM_RETURNVALUE(playlists, ID2P(LANG_PLAYLISTS), GO_TO_PLAYLISTS_SCREEN, | ||
467 | NULL, Icon_Playlist); | ||
468 | MENUITEM_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 |
455 | static int do_shutdown(void) | 472 | static 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 |
diff --git a/apps/root_menu.h b/apps/root_menu.h index 739ec8c4e9..3d18d18604 100644 --- a/apps/root_menu.h +++ b/apps/root_menu.h | |||
@@ -55,7 +55,9 @@ enum { | |||
55 | will need editing if this is the case. */ | 55 | will need editing if this is the case. */ |
56 | GO_TO_BROWSEPLUGINS, | 56 | GO_TO_BROWSEPLUGINS, |
57 | GO_TO_TIMESCREEN, | 57 | GO_TO_TIMESCREEN, |
58 | GO_TO_PLAYLISTS_SCREEN, | ||
58 | GO_TO_PLAYLIST_VIEWER, | 59 | GO_TO_PLAYLIST_VIEWER, |
60 | GO_TO_SYSTEM_SCREEN, | ||
59 | }; | 61 | }; |
60 | 62 | ||
61 | extern const struct menu_item_ex root_menu_; | 63 | extern const struct menu_item_ex root_menu_; |