diff options
Diffstat (limited to 'apps/root_menu.c')
-rw-r--r-- | apps/root_menu.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c index b2684abfda..ad603db8c7 100644 --- a/apps/root_menu.c +++ b/apps/root_menu.c | |||
@@ -279,6 +279,37 @@ static int load_bmarks(void* param) | |||
279 | bookmark_mrb_load(); | 279 | bookmark_mrb_load(); |
280 | return GO_TO_PREVIOUS; | 280 | return GO_TO_PREVIOUS; |
281 | } | 281 | } |
282 | static int plugins_menu(void* param) | ||
283 | { | ||
284 | (void)param; | ||
285 | MENUITEM_STRINGLIST(plugins_menu_items, ID2P(LANG_PLUGINS), NULL, | ||
286 | ID2P(LANG_PLUGIN_GAMES), | ||
287 | ID2P(LANG_PLUGIN_APPS), ID2P(LANG_PLUGIN_DEMOS)); | ||
288 | char *folder; | ||
289 | int retval = GO_TO_PREVIOUS; | ||
290 | int selection = 0, current = 0; | ||
291 | while (retval == GO_TO_PREVIOUS) | ||
292 | { | ||
293 | selection = do_menu(&plugins_menu_items, ¤t); | ||
294 | switch (selection) | ||
295 | { | ||
296 | case 0: | ||
297 | folder = PLUGIN_GAMES_DIR; | ||
298 | break; | ||
299 | case 1: | ||
300 | folder = PLUGIN_APPS_DIR; | ||
301 | break; | ||
302 | case 2: | ||
303 | folder = PLUGIN_DEMOS_DIR; | ||
304 | break; | ||
305 | default: | ||
306 | return selection; | ||
307 | } | ||
308 | retval = rockbox_browse(folder, SHOW_PLUGINS); | ||
309 | } | ||
310 | return retval; | ||
311 | } | ||
312 | |||
282 | /* These are all static const'd from apps/menus/ *.c | 313 | /* These are all static const'd from apps/menus/ *.c |
283 | so little hack so we can use them */ | 314 | so little hack so we can use them */ |
284 | extern struct menu_item_ex | 315 | extern struct menu_item_ex |
@@ -308,7 +339,7 @@ static const struct root_items items[] = { | |||
308 | #endif | 339 | #endif |
309 | 340 | ||
310 | [GO_TO_RECENTBMARKS] = { load_bmarks, NULL, &bookmark_settings_menu }, | 341 | [GO_TO_RECENTBMARKS] = { load_bmarks, NULL, &bookmark_settings_menu }, |
311 | [GO_TO_BROWSEPLUGINS] = { browser, (void*)GO_TO_BROWSEPLUGINS, NULL }, | 342 | [GO_TO_BROWSEPLUGINS] = { plugins_menu, NULL, NULL }, |
312 | 343 | ||
313 | }; | 344 | }; |
314 | static const int nb_items = sizeof(items)/sizeof(*items); | 345 | static const int nb_items = sizeof(items)/sizeof(*items); |