mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
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
This commit is contained in:
parent
cb57a568e8
commit
af9f405651
22 changed files with 729 additions and 1569 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue