Index: tools/buildzip.pl =================================================================== --- tools/buildzip.pl (revision 14178) +++ tools/buildzip.pl (working copy) @@ -207,6 +207,10 @@ mkdir ".rockbox/langs", 0777; mkdir ".rockbox/rocks", 0777; + mkdir ".rockbox/rocks/games", 0777; + mkdir ".rockbox/rocks/apps", 0777; + mkdir ".rockbox/rocks/demos", 0777; + if ($recording) { mkdir ".rockbox/recpresets", 0777; } @@ -274,7 +278,7 @@ open VIEWERS, ">.rockbox/viewers.config" or die "can't create .rockbox/viewers.config"; - mkdir ".rockbox/viewers", 0777; + foreach my $line (@viewers) { if ($line =~ /([^,]*),([^,]*),/) { my ($ext, $plugin)=($1, $2); @@ -299,7 +303,7 @@ if($dir ne "rocks") { # target is not 'rocks' but the plugins are always in that # dir at first! - `mv .rockbox/rocks/$name .rockbox/$r`; + `mv .rockbox/rocks/$name .rockbox/rocks/$r`; } print VIEWERS $line; } @@ -317,6 +321,17 @@ } } close VIEWERS; + + open TARGETDIR, "$ROOT/apps/plugins/TARGETDIR" or + die "can't open TARGETDIR"; + @rock_targetdirs = ; + close TARGETDIR; + foreach my $line (@rock_targetdirs) { + if ($line =~ /([^,]*),(.*)/) { + my ($plugin, $dir)=($1, $2); + `mv .rockbox/rocks/${plugin}.rock .rockbox/rocks/$dir 2> /dev/null`; + } + } if ($bitmap) { mkdir ".rockbox/icons", 0777; @@ -329,8 +344,8 @@ `cp $ROOT/apps/tagnavi.config .rockbox/`; if($bitmap) { - `cp $ROOT/apps/plugins/sokoban.levels .rockbox/rocks/`; # sokoban levels - `cp $ROOT/apps/plugins/snake2.levels .rockbox/rocks/`; # snake2 levels + `cp $ROOT/apps/plugins/sokoban.levels .rockbox/rocks/games/`; # sokoban levels + `cp $ROOT/apps/plugins/snake2.levels .rockbox/rocks/games/`; # snake2 levels } if($image) { Index: apps/plugins/TARGETDIR =================================================================== --- apps/plugins/TARGETDIR (revision 0) +++ apps/plugins/TARGETDIR (revision 0) @@ -0,0 +1,81 @@ +alpine_cdc,apps +battery_bench,apps +blackjack,games +bounce,demos +brickmania,games +bubbles,games +calculator,apps +calendar,apps +chessbox,games +chessclock,apps +chip8,,apps +chopper,games +clock,apps +credits, +cube,demos +demystify,demos +dice,games +dict,apps +disktidy,apps +euroconverter,apps +fire,demos +fireworks,demos +firmware_flash,apps +flipit,games +grayscale,demos +helloworld,demos +invadrox,games +iriver_flash,apps +iriverify,apps +jackpot,games +jewels,games +jpeg,apps +logo,demos +mandelbrot,games +mazezam,games +mem_mon,apps +metronome,apps +midi2wav,apps +midiplay,apps +minesweeper,games +mosaique,demos +mp3_encoder,apps +nim,games +oscilloscope,demos +plasma,demos +pong,games +properties, +random_folder_advance_config,apps +rockblox,games +rockbox_flash,apps +rockboy,games +rocklife,games +rockpaint,apps +search,apps +sliding_puzzle,games +snake2,games +snake,games +snow,demos +sokoban,games +solitaire,games +sort,apps +spacerocks,games +splitedit,apps +star,games +starfield,demos +stats,apps +stopwatch,apps +test_disk,test +test_fps,test +test_sampr,test +test_scanrate,test +text_editor,apps +vbrfix,apps +video,apps +viewer,apps +vu_meter,demos +wav2wv,apps +wavplay,apps +wormlet,games +xobox,games +zxbox,games Index: apps/plugins/viewers.config =================================================================== --- apps/plugins/viewers.config (revision 14178) +++ apps/plugins/viewers.config (working copy) @@ -1,38 +1,38 @@ -ch8,viewers/chip8,0 -txt,viewers/viewer,1 -nfo,viewers/viewer,1 -txt,rocks/text_editor,2 -jpg,viewers/jpeg,2 -jpe,viewers/jpeg,2 -jpeg,viewers/jpeg,2 -ucl,viewers/rockbox_flash,3 -rvf,viewers/video,4 -mp3,viewers/vbrfix,5 -m3u,viewers/search,- -txt,viewers/sort,- -gb,viewers/rockboy,6 -gbc,viewers/rockboy,6 -sgb,viewers/rockboy,6 -m3u,viewers/iriverify,- -mid,viewers/midiplay,7 -rmi,viewers/midiplay,7 -rsp,viewers/searchengine,8 -sok,rocks/sokoban,1 -pgn,rocks/chessbox,1 -ss,rocks/sudoku,1 -wav,viewers/wav2wv,- -wav,viewers/mp3_encoder,- -wav,viewers/wavplay,10 -wav,viewers/wavview,10 -wav,viewers/test_codec,- -bmp,rocks/rockpaint,11 -mpg,viewers/mpegplayer,4 -mpeg,viewers/mpegplayer,4 -iriver,viewers/iriver_flash,3 -tap,viewers/zxbox,12 -sna,viewers/zxbox,12 -tzx,viewers/zxbox,12 -z80,viewers/zxbox,12 -zzz,viewers/properties,- -colours,rocks/text_editor,11 -ssg,rocks/superdom,- +ch8,apps/chip8,0 +txt,apps/viewer,1 +nfo,apps/viewer,1 +txt,apps/text_editor,2 +jpg,apps/jpeg,2 +jpe,apps/jpeg,2 +jpeg,apps/jpeg,2 +ucl,apps/rockbox_flash,3 +rvf,apps/video,4 +mp3,apps/vbrfix,5 +m3u,apps/search,- +txt,apps/sort,- +gb,games/rockboy,6 +gbc,games/rockboy,6 +sgb,games/rockboy,6 +m3u,apps/iriverify,- +mid,apps/midiplay,7 +rmi,apps/midiplay,7 +rsp,apps/searchengine,8 +sok,games/sokoban,1 +pgn,games/chessbox,1 +ss,games/sudoku,1 +wav,apps/wav2wv,- +wav,apps/mp3_encoder,- +wav,apps/wavplay,10 +wav,apps/wavview,10 +wav,apps/test_codec,- +bmp,apps/rockpaint,11 +mpg,apps/mpegplayer,4 +mpeg,apps/mpegplayer,4 +iriver,apps/iriver_flash,3 +tap,apps/zxbox,12 +sna,apps/zxbox,12 +tzx,apps/zxbox,12 +z80,apps/zxbox,12 +zzz,properties,- +colours,apps/text_editor,11 +ssg,games/superdom,- Index: apps/plugins/sudoku/sudoku.h =================================================================== --- apps/plugins/sudoku/sudoku.h (revision 14178) +++ apps/plugins/sudoku/sudoku.h (working copy) @@ -22,7 +22,7 @@ #include "plugin.h" -#define GAME_FILE PLUGIN_DIR "/sudoku.ss" +#define GAME_FILE PLUGIN_GAMES_DIR "/sudoku.ss" /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD Index: apps/plugins/chessbox/chessbox.c =================================================================== --- apps/plugins/chessbox/chessbox.c (revision 14178) +++ apps/plugins/chessbox/chessbox.c (working copy) @@ -241,7 +241,7 @@ #define YOFS ((LCD_HEIGHT-8*TILE_HEIGHT)/2) /* save files */ -#define SAVE_FILE PLUGIN_DIR "/chessbox.save" +#define SAVE_FILE PLUGIN_GAMES_DIR "/chessbox.save" /* commands enum */ #define COMMAND_NOP 0 Index: apps/plugins/chessbox/chessbox_pgn.c =================================================================== --- apps/plugins/chessbox/chessbox_pgn.c (revision 14178) +++ apps/plugins/chessbox/chessbox_pgn.c (working copy) @@ -188,7 +188,7 @@ #error CHESSBOX: Unsupported keypad #endif -#define LOG_FILE PLUGIN_DIR "/chessbox.log" +#define LOG_FILE PLUGIN_GAMES_DIR "/chessbox.log" int loghandler; struct plugin_api* rb; Index: apps/plugins/zxbox.c =================================================================== --- apps/plugins/zxbox.c (revision 14178) +++ apps/plugins/zxbox.c (working copy) @@ -26,6 +26,6 @@ /* this is the plugin entry point */ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { - return run_overlay(api, parameter, "/.rockbox/viewers/zxbox.ovl", "ZXBox"); + return run_overlay(api, parameter, PLUGIN_APPS_DIR "/zxbox.ovl", "ZXBox"); } #endif Index: apps/plugins/clock/clock_settings.h =================================================================== --- apps/plugins/clock/clock_settings.h (revision 14178) +++ apps/plugins/clock/clock_settings.h (working copy) @@ -78,7 +78,7 @@ extern struct clock_settings clock_settings; /* settings are saved to this location */ -#define settings_filename "/.rockbox/rocks/.clock_settings" +#define settings_filename PLUGIN_GAMES_DIR "/.clock_settings" void clock_settings_skin_next(struct clock_settings* settings); void clock_settings_skin_previous(struct clock_settings* settings); Index: apps/plugins/chessbox.c =================================================================== --- apps/plugins/chessbox.c (revision 14178) +++ apps/plugins/chessbox.c (working copy) @@ -29,6 +29,6 @@ /* this is the plugin entry point */ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { - return run_overlay(api, parameter, "/.rockbox/rocks/chessbox.ovl", "ChessBox"); + return run_overlay(api, parameter, PLUGIN_GAMES_DIR "/chessbox.ovl", "ChessBox"); } #endif Index: apps/plugins/rockblox.c =================================================================== --- apps/plugins/rockblox.c (revision 14178) +++ apps/plugins/rockblox.c (working copy) @@ -477,7 +477,7 @@ }; /* Rockbox File System only supports full filenames inc dir */ -#define HIGH_SCORE "/.rockbox/rocks/rockblox.score" +#define HIGH_SCORE PLUGIN_GAMES_DIR "/rockblox.score" #define MAX_HIGH_SCORES 5 /* Default High Scores... */ struct highscore Highest[MAX_HIGH_SCORES]; Index: apps/plugins/snake2.c =================================================================== --- apps/plugins/snake2.c (revision 14178) +++ apps/plugins/snake2.c (working copy) @@ -321,8 +321,8 @@ #define SOUTH_EAST 2048 #define SOUTH_WEST 4096 -#define LEVELS_FILE PLUGIN_DIR "/snake2.levels" -#define HISCORE_FILE PLUGIN_DIR "/snake2.hs" +#define LEVELS_FILE PLUGIN_GAMES_DIR "/snake2.levels" +#define HISCORE_FILE PLUGIN_GAMES_DIR "/snake2.hs" int load_all_levels(void) { Index: apps/plugins/lib/configfile.c =================================================================== --- apps/plugins/lib/configfile.c (revision 14178) +++ apps/plugins/lib/configfile.c (working copy) @@ -26,14 +26,32 @@ cfg_rb = newrb; } +void get_cfg_filename(char* buf, int buf_len, const char* filename) +{ + char *s; + cfg_rb->strcpy(buf, cfg_rb->plugin_get_current_filename); + s = cfg_rb->strrchr(buf, '/'); + if (!s) /* should never happen */ + { + cfg_rb->snprintf(buf, buf_len, "/.rockbox/rocks/%s", filename); + } + else + { + s++; + *s = '\0'; + cfg_rb->strcat(s, filename); + } +} + int configfile_save(const char *filename, struct configdata *cfg, int num_items, int version) { int fd; int i; char buf[MAX_PATH]; + char current_rock_folder[MAX_PATH]; - cfg_rb->snprintf(buf, MAX_PATH, "/.rockbox/rocks/%s", filename); + get_cfg_filename(buf, MAX_PATH, filename); fd = cfg_rb->creat(buf); if(fd < 0) return fd*10 - 1; @@ -78,7 +96,7 @@ int file_version = -1; int tmp; - cfg_rb->snprintf(buf, MAX_PATH, "/.rockbox/rocks/%s", filename); + get_cfg_filename(buf, MAX_PATH, filename); fd = cfg_rb->open(buf, O_RDONLY); if(fd < 0) return fd*10 - 1; Index: apps/plugins/vu_meter.c =================================================================== --- apps/plugins/vu_meter.c (revision 14178) +++ apps/plugins/vu_meter.c (working copy) @@ -236,7 +236,7 @@ } void load_settings(void) { - int fp = rb->open("/.rockbox/rocks/.vu_meter", O_RDONLY); + int fp = rb->open(PLUGIN_DEMO_DIR "/.vu_meter", O_RDONLY); if(fp>=0) { rb->read(fp, &vumeter_settings, sizeof(struct saved_settings)); rb->close(fp); @@ -252,7 +252,7 @@ } void save_settings(void) { - int fp = rb->creat("/.rockbox/rocks/.vu_meter"); + int fp = rb->creat(PLUGIN_DEMOS_DIR "/.vu_meter"); if(fp >= 0) { rb->write (fp, &vumeter_settings, sizeof(struct saved_settings)); rb->close(fp); Index: apps/plugins/sokoban.c =================================================================== --- apps/plugins/sokoban.c (revision 14178) +++ apps/plugins/sokoban.c (working copy) @@ -33,8 +33,8 @@ #define SOKOBAN_TITLE "Sokoban" -#define SOKOBAN_LEVELS_FILE PLUGIN_DIR "/sokoban.levels" -#define SOKOBAN_SAVE_FILE PLUGIN_DIR "/sokoban.save" +#define SOKOBAN_LEVELS_FILE PLUGIN_GAMES_DIR "/sokoban.levels" +#define SOKOBAN_SAVE_FILE PLUGIN_GAMES_DIR "/sokoban.save" #define SOKOBAN_SAVE_FOLDER "/games" /* Magnify is the number of pixels for each block. Index: apps/plugins/spacerocks.c =================================================================== --- apps/plugins/spacerocks.c (revision 14178) +++ apps/plugins/spacerocks.c (working copy) @@ -162,7 +162,7 @@ #define WRAP_GAP 12 #define EXPLOSION_LENGTH 20 #define SHOW_COL 0 -#define HISCORE_FILE PLUGIN_DIR "/astrorocks.hs" +#define HISCORE_FILE PLUGIN_GAMES_DIR "/astrorocks.hs" #define POINT_SIZE 2 #define MAX_NUM_ASTEROIDS 25 #define MAX_NUM_MISSILES 6 Index: apps/plugins/reversi/reversi-gui.h =================================================================== --- apps/plugins/reversi/reversi-gui.h (revision 14178) +++ apps/plugins/reversi/reversi-gui.h (working copy) @@ -22,7 +22,7 @@ #include "plugin.h" -#define GAME_FILE PLUGIN_DIR "/reversi.rev" +#define GAME_FILE PLUGIN_GAMES_DIR "/reversi.rev" /* variable button definitions */ #if CONFIG_KEYPAD == RECORDER_PAD Index: apps/plugins/viewer.c =================================================================== --- apps/plugins/viewer.c (revision 14178) +++ apps/plugins/viewer.c (working copy) @@ -24,8 +24,8 @@ PLUGIN_HEADER -#define SETTINGS_FILE "/.rockbox/viewers/viewer.dat" /* binary file, so dont use .cfg */ -#define BOOKMARKS_FILE "/.rockbox/viewers/viewer_bookmarks.dat" +#define SETTINGS_FILE PLUGIN_APPS_DIR "/viewer.dat" /* binary file, so dont use .cfg */ +#define BOOKMARKS_FILE PLUGIN_APPS_DIR "/viewer_bookmarks.dat" #define WRAP_TRIM 44 /* Max number of spaces to trim (arbitrary) */ #define MAX_COLUMNS 64 /* Max displayable string len (over-estimate) */ Index: apps/plugins/blackjack.c =================================================================== --- apps/plugins/blackjack.c (revision 14178) +++ apps/plugins/blackjack.c (working copy) @@ -24,8 +24,8 @@ PLUGIN_HEADER /* save files */ -#define SCORE_FILE PLUGIN_DIR "/blackjack.score" -#define SAVE_FILE PLUGIN_DIR "/blackjack.save" +#define SCORE_FILE PLUGIN_GAMES_DIR "/blackjack.score" +#define SAVE_FILE PLUGIN_GAMES_DIR "/blackjack.save" #define NUM_SCORES LCD_HEIGHT/8-2 Index: apps/plugins/rockboy.c =================================================================== --- apps/plugins/rockboy.c (revision 14178) +++ apps/plugins/rockboy.c (working copy) @@ -29,6 +29,6 @@ /* this is the plugin entry point */ enum plugin_status plugin_start(struct plugin_api* api, void* parameter) { - return run_overlay(api, parameter, "/.rockbox/viewers/rockboy.ovl", "RockBoy"); + return run_overlay(api, parameter, PLUGIN_GAMES_DIR "/rockboy.ovl", "RockBoy"); } #endif Index: apps/plugins/bubbles.c =================================================================== --- apps/plugins/bubbles.c (revision 14178) +++ apps/plugins/bubbles.c (working copy) @@ -30,8 +30,8 @@ PLUGIN_HEADER /* files */ -#define SCORE_FILE PLUGIN_DIR "/bubbles.score" -#define SAVE_FILE PLUGIN_DIR "/bubbles.save" +#define SCORE_FILE PLUGIN_GAMES_DIR "/bubbles.score" +#define SAVE_FILE PLUGIN_GAMES_DIR "/bubbles.save" /* final game return status */ #define BB_NONE 5 Index: apps/plugins/jewels.c =================================================================== --- apps/plugins/jewels.c (revision 14178) +++ apps/plugins/jewels.c (working copy) @@ -178,8 +178,8 @@ #endif /* save files */ -#define SCORE_FILE PLUGIN_DIR "/jewels.score" -#define SAVE_FILE PLUGIN_DIR "/jewels.save" +#define SCORE_FILE PLUGIN_GAMES_DIR "/jewels.score" +#define SAVE_FILE PLUGIN_GAMES_DIR "/jewels.save" /* final game return status */ #define BJ_QUIT_FROM_GAME 4 Index: apps/plugins/invadrox.c =================================================================== --- apps/plugins/invadrox.c (revision 14178) +++ apps/plugins/invadrox.c (working copy) @@ -559,7 +559,7 @@ #define TARGET_BOTTOM 3 #define TARGET_UFO 4 -#define HISCOREFILE "/.rockbox/rocks/invadrox.high" +#define HISCOREFILE PLUGIN_GAMES_DIR "/invadrox.high" /* The time (in ms) for one iteration through the game loop - decrease this Index: apps/plugins/rockpaint.c =================================================================== --- apps/plugins/rockpaint.c (revision 14178) +++ apps/plugins/rockpaint.c (working copy) @@ -130,7 +130,7 @@ #define COLOR_BROWN LCD_RGBPACK(128,64,0) #define COLOR_LIGHTBROWN LCD_RGBPACK(255,128,64) -#define SPLASH_SCREEN PLUGIN_DIR "/rockpaint/splash.bmp" +#define SPLASH_SCREEN PLUGIN_APPS_DIR "/rockpaint/splash.bmp" #define ROCKPAINT_TITLE_FONT 2 /*********************************************************************** Index: apps/lang/english.lang =================================================================== --- apps/lang/english.lang (revision 14178) +++ apps/lang/english.lang (working copy) @@ -11067,4 +11067,60 @@ *: "" + + + id: LANG_PLUGIN_GAMES + desc: in the main menu + user: + + *: "Games" + + + *: "Games" + + + *: "Games" + + + + id: LANG_PLUGIN_APPS + desc: in the main menu + user: + + *: "Applications" + + + *: "Applications" + + + *: "Applications" + + + + id: LANG_PLUGIN_DEMOS + desc: in the main menu + user: + + *: "Demos" + + + *: "Demos" + + + *: "Demos" + + + + id: LANG_PLUGIN_UNSORTED + desc: in the main menu + user: + + *: "Misc" + + + *: "Misc" + + + *: "Misc" + \ No newline at end of file Index: apps/settings.h =================================================================== --- apps/settings.h (revision 14178) +++ apps/settings.h (working copy) @@ -56,8 +56,13 @@ #define WPS_DIR ROCKBOX_DIR "/wps" #define THEME_DIR ROCKBOX_DIR "/themes" #define ICON_DIR ROCKBOX_DIR "/icons" -#define PLUGIN_DIR ROCKBOX_DIR "/rocks" -#define VIEWERS_DIR ROCKBOX_DIR "/viewers" + +#define PLUGIN_DIR ROCKBOX_DIR "/rocks" +#define PLUGIN_GAMES_DIR PLUGIN_DIR "/games" +#define PLUGIN_APPS_DIR PLUGIN_DIR "/apps" +#define PLUGIN_DEMOS_DIR PLUGIN_DIR "/demos" +#define VIEWERS_DIR PLUGIN_APPS_DIR + #define BACKDROP_DIR ROCKBOX_DIR "/backdrops" #define REC_BASE_DIR "/" #define EQS_DIR ROCKBOX_DIR "/eqs" Index: apps/plugin.c =================================================================== --- apps/plugin.c (revision 14178) +++ apps/plugin.c (working copy) @@ -64,6 +64,8 @@ static bool (*pfn_tsr_exit)(bool reenter) = NULL; /* TSR exit callback */ static char current_plugin[MAX_PATH]; +char *plugin_get_current_filename(void); + extern struct thread_entry threads[MAXTHREADS]; static const struct plugin_api rockbox_api = { @@ -499,6 +501,7 @@ screen_clear_area, #endif led, + plugin_get_current_filename, }; int plugin_load(const char* plugin, void* parameter) @@ -732,3 +735,8 @@ { pfn_tsr_exit = exit_callback; /* remember the callback for later */ } + +char *plugin_get_current_filename(void) +{ + return current_plugin; +} Index: apps/plugin.h =================================================================== --- apps/plugin.h (revision 14178) +++ apps/plugin.h (working copy) @@ -112,12 +112,12 @@ #define PLUGIN_MAGIC 0x526F634B /* RocK */ /* increase this every time the api struct changes */ -#define PLUGIN_API_VERSION 69 +#define PLUGIN_API_VERSION 70 /* update this to latest version if a change to the api struct breaks backwards compatibility (and please take the opportunity to sort in any new function which are "waiting" at the end of the function table) */ -#define PLUGIN_MIN_API_VERSION 69 +#define PLUGIN_MIN_API_VERSION 70 /* plugin return codes */ enum plugin_status { @@ -620,6 +620,7 @@ int width, int height); #endif void (*led)(bool on); + char* (*plugin_get_current_filename)(void); }; /* plugin header */ Index: apps/filetypes.c =================================================================== --- apps/filetypes.c (revision 14178) +++ apps/filetypes.c (working copy) @@ -119,7 +119,6 @@ struct file_type { int icon; /* the icon which shall be used for it, NOICON if unknown */ - bool viewer; /* true if the rock is in viewers, false if in rocks */ unsigned char attr; /* FILETYPES_MASK >> 8 */ char* plugin; /* Which plugin to use, NULL if unknown, or builtin */ char* extension; /* NULL for none */ @@ -289,7 +288,6 @@ { char line[64], *s, *e; char extension[8], plugin[32]; - bool viewer; int fd = open(config_file, O_RDONLY); if (fd < 0) return; @@ -314,24 +312,15 @@ /* get the plugin */ s = e+1; - e = strchr(s, '/'); - if (!e) - continue; - *e = '\0'; - if (!strcasecmp("viewers", s)) - viewer = true; - else - viewer = false; - s = e+1; e = strchr(s, ','); if (!e) continue; *e = '\0'; + strcpy(plugin, s); /* ok, store this plugin/extension, check icon after */ filetypes[filetype_count].extension = filetypes_strdup(extension); filetypes[filetype_count].plugin = filetypes_strdup(plugin); - filetypes[filetype_count].viewer = viewer; filetypes[filetype_count].attr = heighest_attr +1; filetypes[filetype_count].icon = Icon_Questionmark; heighest_attr++; @@ -422,8 +411,7 @@ if (filetypes[index].plugin == NULL) return NULL; snprintf(plugin_name, MAX_PATH, "%s/%s.%s", - filetypes[index].viewer? VIEWERS_DIR: PLUGIN_DIR, - filetypes[index].plugin, ROCK_EXTENSION); + PLUGIN_DIR, filetypes[index].plugin, ROCK_EXTENSION); return plugin_name; } Index: apps/root_menu.c =================================================================== --- apps/root_menu.c (revision 14178) +++ apps/root_menu.c (working copy) @@ -261,6 +261,40 @@ bookmark_mrb_load(); return GO_TO_PREVIOUS; } +static int plugins_menu(void* param) +{ + (void)param; + MENUITEM_STRINGLIST(plugins_menu_items, ID2P(LANG_PLUGINS), NULL, + ID2P(LANG_PLUGIN_UNSORTED), ID2P(LANG_PLUGIN_GAMES), + ID2P(LANG_PLUGIN_APPS), ID2P(LANG_PLUGIN_DEMOS)); + char *folder; + int retval = GO_TO_PREVIOUS; + int selection = 0, current = 0; + while (retval == GO_TO_PREVIOUS) + { + selection = do_menu(&plugins_menu_items, ¤t); + switch (selection) + { + case 0: + folder = PLUGIN_DIR; + break; + case 1: + folder = PLUGIN_GAMES_DIR; + break; + case 2: + folder = PLUGIN_APPS_DIR; + break; + case 3: + folder = PLUGIN_DEMOS_DIR; + break; + default: + return selection; + } + retval = rockbox_browse(folder, SHOW_PLUGINS); + } + return retval; +} + /* These are all static const'd from apps/menus/ *.c so little hack so we can use them */ extern struct menu_item_ex @@ -290,7 +324,7 @@ #endif [GO_TO_RECENTBMARKS] = { load_bmarks, NULL, &bookmark_settings_menu }, - [GO_TO_BROWSEPLUGINS] = { browser, (void*)GO_TO_BROWSEPLUGINS, NULL }, + [GO_TO_BROWSEPLUGINS] = { plugins_menu, NULL, NULL }, }; static const int nb_items = sizeof(items)/sizeof(*items);