diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-01 11:14:46 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-03-01 11:14:46 +0000 |
commit | 91cb68a1fb5b019aaebf77fae6506bb807059b65 (patch) | |
tree | ea3e56a915479ecad597cc0769ca24c2e2bcf686 /apps/menus/main_menu.c | |
parent | d94c7d3f7679789cce916d213b39f3b54dc0216b (diff) |
Introducing the root menu!
Blind users: get a new voice file as there are lots of lang changes and new strings.
FS#6630 or RootMenu on the wiki for more info. complaints to /dev/null :)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12528 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menus/main_menu.c')
-rw-r--r-- | apps/menus/main_menu.c | 63 |
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 @@ #include "settings_menu.h" #include "exported_menus.h" #include "tree.h" -#if CONFIG_TUNER -#include "radio.h" -#endif #ifdef HAVE_RECORDING #include "recording.h" #endif @@ -49,9 +46,6 @@ #include "logfdisp.h" #endif -/* lazy coders can use this function if the needed callback - is just to say if the item is shown or not */ -int dynamicitem_callback(int action,const struct menu_item_ex *this_item); struct browse_folder_info { @@ -59,12 +53,11 @@ struct browse_folder_info { int show_options; }; static struct browse_folder_info theme = {THEME_DIR, SHOW_CFG}; -static struct browse_folder_info rocks = {PLUGIN_DIR, SHOW_PLUGINS}; static struct browse_folder_info config = {ROCKBOX_DIR, SHOW_CFG}; static int browse_folder(void *param) { const struct browse_folder_info *info = - (const struct browse_folder_info*)param; + (const struct browse_folder_info*)param; return rockbox_browse(info->dir, info->show_options); } @@ -384,26 +377,6 @@ MAKE_MENU(info_menu, ID2P(LANG_INFO), 0, bitmap_icons_6x8[Icon_Questionmark], MENUITEM_FUNCTION_WPARAM(browse_themes, ID2P(LANG_CUSTOM_THEME), browse_folder, (void*)&theme, NULL, bitmap_icons_6x8[Icon_Folder]); -MENUITEM_FUNCTION_WPARAM(browse_plugins, ID2P(LANG_PLUGINS), - browse_folder, (void*)&rocks, NULL, bitmap_icons_6x8[Icon_Plugin]); - -#if CONFIG_TUNER -MENUITEM_FUNCTION(load_radio_screen, ID2P(LANG_FM_RADIO), - (menu_function)radio_screen, dynamicitem_callback, - bitmap_icons_6x8[Icon_Radio_screen]); -#endif - -MENUITEM_FUNCTION(mrb_bookmarks, ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS), - (menu_function)bookmark_mrb_load, NULL, bitmap_icons_6x8[Icon_Bookmark]); - -#ifdef HAVE_LCD_CHARCELLS -static int do_shutdown(void) -{ - sys_poweroff(); - return 0; -} -MENUITEM_FUNCTION(do_shutdown_item, ID2P(LANG_SHUTDOWN), do_shutdown, NULL, NOICON); -#endif #ifdef HAVE_LCD_CHARCELLS int 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) #else #define mainmenu_callback NULL #endif -/* NOTE: This title will be translatable once we decide what to call this menu - when the root menu comes in... hopefully in the next few days */ -MAKE_MENU(main_menu_, "Rockbox Main Menu", mainmenu_callback, +MAKE_MENU(main_menu_, ID2P(LANG_SETTINGS_MENU), mainmenu_callback, bitmap_icons_6x8[Icon_Submenu_Entered], - &mrb_bookmarks, &sound_settings, + &sound_settings, &settings_menu_item, &manage_settings, &browse_themes, -#if CONFIG_TUNER - &load_radio_screen, -#endif #ifdef HAVE_RECORDING - &recording_settings_menu, -#endif - &playlist_menu_item, &browse_plugins, &info_menu -#ifdef HAVE_LCD_CHARCELLS - ,&do_shutdown_item + &recording_settings, #endif ); /* MAIN MENU */ /***********************************/ -/* lazy coders can use this function if the needed - callback is just to say if the item is shown or not */ -int dynamicitem_callback(int action,const struct menu_item_ex *this_item) -{ - if (action != ACTION_REQUEST_MENUITEM) - return action; - -#if CONFIG_TUNER - if (this_item == &load_radio_screen) - { - if (radio_hardware_present() == 0) - return ACTION_EXIT_MENUITEM; - } -#else - (void)this_item; -#endif - - return action; -} |