diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-06-16 04:25:21 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-06-16 04:25:21 +0000 |
| commit | af9f4056510f248c4c9c1335167853bb455e8cc0 (patch) | |
| tree | eff7ad7726083ee605d753bd9aa9e22213b1acf0 /apps/plugins/test_disk.c | |
| parent | cb57a568e8dc9def607dc9ab27f515309bd13841 (diff) | |
| download | rockbox-af9f4056510f248c4c9c1335167853bb455e8cc0.zip rockbox-af9f4056510f248c4c9c1335167853bb455e8cc0.tar.gz rockbox-af9f4056510f248c4c9c1335167853bb455e8cc0.tar.bz2 rockbox-af9f4056510f248c4c9c1335167853bb455e8cc0.tar.xz | |
Accept FS#10094 by Teruaki Kawashima:
Replace the old menu API with the "new" one (a very long time overdue so huge thanks for the work.)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21306 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/test_disk.c')
| -rw-r--r-- | apps/plugins/test_disk.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/apps/plugins/test_disk.c b/apps/plugins/test_disk.c index 2fa841b..34cb94d 100644 --- a/apps/plugins/test_disk.c +++ b/apps/plugins/test_disk.c @@ -20,7 +20,6 @@ ****************************************************************************/ #include "plugin.h" -#include "lib/oldmenuapi.h" #include "lib/helper.h" PLUGIN_HEADER @@ -406,11 +405,10 @@ static bool test_speed(void) /* this is the plugin entry point */ enum plugin_status plugin_start(const void* parameter) { - static const struct menu_item items[] = { - { "Disk speed", test_speed }, - { "Write & verify", test_fs }, - }; - int m; + MENUITEM_STRINGLIST(menu, "Test Disk Menu", NULL, + "Disk speed", "Write & verify"); + int selected=0; + bool quit = false; int align; DIR *dir; @@ -440,10 +438,21 @@ enum plugin_status plugin_start(const void* parameter) /* Turn off backlight timeout */ backlight_force_on(); /* backlight control in lib/helper.c */ - m = menu_init(items, sizeof(items) / sizeof(*items), NULL, - NULL, NULL, NULL); - menu_run(m); - menu_exit(m); + while(!quit) + { + switch(rb->do_menu(&menu, &selected, NULL, false)) + { + case 0: + test_speed(); + break; + case 1: + test_fs(); + break; + default: + quit = true; + break; + } + } /* Turn on backlight timeout (revert to settings) */ backlight_use_settings(); /* backlight control in lib/helper.c */ |