summaryrefslogtreecommitdiff
path: root/apps/menus/main_menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/menus/main_menu.c')
-rw-r--r--apps/menus/main_menu.c63
1 files changed, 4 insertions, 59 deletions
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c
index b367fded35..d986436311 100644
--- a/apps/menus/main_menu.c
+++ b/apps/menus/main_menu.c
@@ -30,9 +30,6 @@
30#include "settings_menu.h" 30#include "settings_menu.h"
31#include "exported_menus.h" 31#include "exported_menus.h"
32#include "tree.h" 32#include "tree.h"
33#if CONFIG_TUNER
34#include "radio.h"
35#endif
36#ifdef HAVE_RECORDING 33#ifdef HAVE_RECORDING
37#include "recording.h" 34#include "recording.h"
38#endif 35#endif
@@ -49,9 +46,6 @@
49#include "logfdisp.h" 46#include "logfdisp.h"
50#endif 47#endif
51 48
52/* lazy coders can use this function if the needed callback
53 is just to say if the item is shown or not */
54int dynamicitem_callback(int action,const struct menu_item_ex *this_item);
55 49
56 50
57struct browse_folder_info { 51struct browse_folder_info {
@@ -59,12 +53,11 @@ struct browse_folder_info {
59 int show_options; 53 int show_options;
60}; 54};
61static struct browse_folder_info theme = {THEME_DIR, SHOW_CFG}; 55static struct browse_folder_info theme = {THEME_DIR, SHOW_CFG};
62static struct browse_folder_info rocks = {PLUGIN_DIR, SHOW_PLUGINS};
63static struct browse_folder_info config = {ROCKBOX_DIR, SHOW_CFG}; 56static struct browse_folder_info config = {ROCKBOX_DIR, SHOW_CFG};
64static int browse_folder(void *param) 57static int browse_folder(void *param)
65{ 58{
66 const struct browse_folder_info *info = 59 const struct browse_folder_info *info =
67 (const struct browse_folder_info*)param; 60 (const struct browse_folder_info*)param;
68 return rockbox_browse(info->dir, info->show_options); 61 return rockbox_browse(info->dir, info->show_options);
69} 62}
70 63
@@ -384,26 +377,6 @@ MAKE_MENU(info_menu, ID2P(LANG_INFO), 0, bitmap_icons_6x8[Icon_Questionmark],
384 377
385MENUITEM_FUNCTION_WPARAM(browse_themes, ID2P(LANG_CUSTOM_THEME), 378MENUITEM_FUNCTION_WPARAM(browse_themes, ID2P(LANG_CUSTOM_THEME),
386 browse_folder, (void*)&theme, NULL, bitmap_icons_6x8[Icon_Folder]); 379 browse_folder, (void*)&theme, NULL, bitmap_icons_6x8[Icon_Folder]);
387MENUITEM_FUNCTION_WPARAM(browse_plugins, ID2P(LANG_PLUGINS),
388 browse_folder, (void*)&rocks, NULL, bitmap_icons_6x8[Icon_Plugin]);
389
390#if CONFIG_TUNER
391MENUITEM_FUNCTION(load_radio_screen, ID2P(LANG_FM_RADIO),
392 (menu_function)radio_screen, dynamicitem_callback,
393 bitmap_icons_6x8[Icon_Radio_screen]);
394#endif
395
396MENUITEM_FUNCTION(mrb_bookmarks, ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS),
397 (menu_function)bookmark_mrb_load, NULL, bitmap_icons_6x8[Icon_Bookmark]);
398
399#ifdef HAVE_LCD_CHARCELLS
400static int do_shutdown(void)
401{
402 sys_poweroff();
403 return 0;
404}
405MENUITEM_FUNCTION(do_shutdown_item, ID2P(LANG_SHUTDOWN), do_shutdown, NULL, NOICON);
406#endif
407 380
408#ifdef HAVE_LCD_CHARCELLS 381#ifdef HAVE_LCD_CHARCELLS
409int mainmenu_callback(int action,const struct menu_item_ex *this_item) 382int mainmenu_callback(int action,const struct menu_item_ex *this_item)
@@ -423,42 +396,14 @@ int mainmenu_callback(int action,const struct menu_item_ex *this_item)
423#else 396#else
424#define mainmenu_callback NULL 397#define mainmenu_callback NULL
425#endif 398#endif
426/* NOTE: This title will be translatable once we decide what to call this menu 399MAKE_MENU(main_menu_, ID2P(LANG_SETTINGS_MENU), mainmenu_callback,
427 when the root menu comes in... hopefully in the next few days */
428MAKE_MENU(main_menu_, "Rockbox Main Menu", mainmenu_callback,
429 bitmap_icons_6x8[Icon_Submenu_Entered], 400 bitmap_icons_6x8[Icon_Submenu_Entered],
430 &mrb_bookmarks, &sound_settings, 401 &sound_settings,
431 &settings_menu_item, &manage_settings, &browse_themes, 402 &settings_menu_item, &manage_settings, &browse_themes,
432#if CONFIG_TUNER
433 &load_radio_screen,
434#endif
435#ifdef HAVE_RECORDING 403#ifdef HAVE_RECORDING
436 &recording_settings_menu, 404 &recording_settings,
437#endif
438 &playlist_menu_item, &browse_plugins, &info_menu
439#ifdef HAVE_LCD_CHARCELLS
440 ,&do_shutdown_item
441#endif 405#endif
442 ); 406 );
443/* MAIN MENU */ 407/* MAIN MENU */
444/***********************************/ 408/***********************************/
445 409
446/* lazy coders can use this function if the needed
447 callback is just to say if the item is shown or not */
448int dynamicitem_callback(int action,const struct menu_item_ex *this_item)
449{
450 if (action != ACTION_REQUEST_MENUITEM)
451 return action;
452
453#if CONFIG_TUNER
454 if (this_item == &load_radio_screen)
455 {
456 if (radio_hardware_present() == 0)
457 return ACTION_EXIT_MENUITEM;
458 }
459#else
460 (void)this_item;
461#endif
462
463 return action;
464}