Index: tools/buildzip.pl =================================================================== --- tools/buildzip.pl (revision 13838) +++ tools/buildzip.pl (working copy) @@ -327,7 +327,8 @@ } `cp $ROOT/apps/tagnavi.config .rockbox/`; - + `cp $ROOT/apps/menus/custom_menu.config .rockbox/`; + if($bitmap) { `cp $ROOT/apps/plugins/sokoban.levels .rockbox/rocks/`; # sokoban levels `cp $ROOT/apps/plugins/snake2.levels .rockbox/rocks/`; # snake2 levels Index: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (revision 13838) +++ apps/lang/english.lang (working copy) @@ -11048,3 +11048,17 @@ *: "Can't write to recording directory" + + id: LANG_CUSTOM_MENU + desc: + user: + + *: "Custom Menu" + + + *: "Custom Menu" + + + *: "Custom Menu" + + Index: apps/menu.c =================================================================== --- apps/menu.c (revision 13838) +++ apps/menu.c (working copy) @@ -223,7 +223,8 @@ int type; unsigned char *str; int sel; - + if (MENU_GET_COUNT(menu->flags) == 0) + return; if (talk_menus_enabled()) { sel = get_menu_selection(gui_synclist_get_sel_pos(lists),menu); Index: apps/menus/custom_menu.c =================================================================== --- apps/menus/custom_menu.c (revision 0) +++ apps/menus/custom_menu.c (revision 0) @@ -0,0 +1,79 @@ +/*************************************************************************** +* __________ __ ___. +* Open \______ \ ____ ____ | | _\_ |__ _______ ___ +* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / +* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < +* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +* \/ \/ \/ \/ \/ +* $Id: root_menu.h 13126 2007-04-12 15:28:51Z jdgordon $ +* +* Copyright (C) 2007 Jonathan Gordon +* +* All files in this archive are subject to the GNU General Public License. +* See the file COPYING in the source tree root for full license agreement. +* +* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +* KIND, either express or implied. +* +****************************************************************************/ +#include "config.h" +#include "string.h" +#include "menu.h" +#include "settings_list.h" +#include "settings.h" +#include "misc.h" +#include "lang.h" + +#define USER_MENU_FILENAME ROCKBOX_DIR "/user_custom_menu.config" +#define DEFAULT_MENU_FILENAME ROCKBOX_DIR "/custom_menu.config" +#define MAX_ITEMS 16 +/* not sure why both are needed, but it works */ +static struct menu_item_ex menu_settings[MAX_ITEMS]; +static struct menu_item_ex *real_menu_items[MAX_ITEMS]; + +static const struct menu_callback_with_desc callback_item = + {NULL, ID2P(LANG_CUSTOM_MENU), Icon_Config}; +struct menu_item_ex custom_menu; + +void init_custom_menu(void) +{ + int i, count = 0; + int fd = open(USER_MENU_FILENAME, O_RDONLY); + char buf[MAX_PATH]; + custom_menu.flags = MT_MENU|MENU_HAS_DESC|MENU_ITEM_COUNT(0); + if (fd < 0) + { + fd = open(DEFAULT_MENU_FILENAME, O_RDONLY); + if (fd < 0) + return; + } + while (count < MAX_ITEMS && + read_line(fd, buf, MAX_PATH) ) + { + for (i=0; i ) \___| < | \_\ ( <_> > < < +* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ +* \/ \/ \/ \/ \/ +* $Id: root_menu.h 13126 2007-04-12 15:28:51Z jdgordon $ +* +* Copyright (C) 2007 Jonathan Gordon +* +* All files in this archive are subject to the GNU General Public License. +* See the file COPYING in the source tree root for full license agreement. +* +* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY +* KIND, either express or implied. +* +****************************************************************************/ +#ifndef __CUSTOM_MENU_H__ +#define __CUSTOM_MENU_H__ +void init_custom_menu(void); +int run_custom_menu(void* dummy); +struct menu_item_ex custom_menu; +#endif /* __CUSTOM_MENU_H__ */ Index: apps/SOURCES =================================================================== --- apps/SOURCES (revision 13838) +++ apps/SOURCES (working copy) @@ -10,6 +10,7 @@ language.c main.c menu.c +menus/custom_menu.c menus/display_menu.c #if CONFIG_CODEC == SWCODEC menus/eq_menu.c Index: apps/root_menu.c =================================================================== --- apps/root_menu.c (revision 13838) +++ apps/root_menu.c (working copy) @@ -35,6 +35,7 @@ #include "talk.h" #include "audio.h" #include "hotswap.h" +#include "menus/custom_menu.h" #if (LCD_DEPTH > 1) || (defined(HAVE_LCD_REMOTE) && (LCD_REMOTE_DEPTH > 1)) #include "backdrop.h" @@ -291,6 +292,7 @@ [GO_TO_RECENTBMARKS] = { load_bmarks, NULL, &bookmark_settings_menu }, [GO_TO_BROWSEPLUGINS] = { browser, (void*)GO_TO_BROWSEPLUGINS, NULL }, + [GO_TO_CUSTOM_MENU] = { run_custom_menu, NULL, NULL }, }; static const int nb_items = sizeof(items)/sizeof(*items); @@ -359,6 +361,7 @@ #ifdef HAVE_LCD_CHARCELLS ,&do_shutdown_item #endif + ,&custom_menu ); int item_callback(int action, const struct menu_item_ex *this_item) Index: apps/root_menu.h =================================================================== --- apps/root_menu.h (revision 13838) +++ apps/root_menu.h (working copy) @@ -47,6 +47,7 @@ be the "start screen" after a boot up. The setting in settings_list.c will need editing if this is the case. */ GO_TO_BROWSEPLUGINS, + GO_TO_CUSTOM_MENU, }; extern const struct menu_item_ex root_menu_; Index: apps/main.c =================================================================== --- apps/main.c (revision 13838) +++ apps/main.c (working copy) @@ -61,6 +61,7 @@ #include "plugin.h" #include "misc.h" #include "dircache.h" +#include "menus/custom_menu.h" #ifdef HAVE_TAGCACHE #include "tagcache.h" #include "tagtree.h" @@ -267,6 +268,7 @@ settings_load(SETTINGS_ALL); gui_sync_wps_init(); settings_apply(); + init_custom_menu(); init_dircache(true); init_dircache(false); #ifdef HAVE_TAGCACHE @@ -490,6 +492,7 @@ gui_sync_wps_init(); settings_apply(); + init_custom_menu(); init_dircache(false); #ifdef HAVE_TAGCACHE init_tagcache();