From c7f5cccd3e061c8a53e919d117a2adb3fe58473b Mon Sep 17 00:00:00 2001 From: Tom Ross Date: Wed, 28 Mar 2007 07:33:18 +0000 Subject: Adjust plugins to use the new menu API. Int settings still use the old API. Remove a nasty global in Star and add some error checking. Add a work-around for the gigabeat so that Star doesn't crash on target. The transition works fine on the sim and I see nothing obviously wrong with the code but it manages to crash on target everytime. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12946 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/disktidy.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'apps/plugins/disktidy.c') diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c index f5e34cd..d1f40cf 100644 --- a/apps/plugins/disktidy.c +++ b/apps/plugins/disktidy.c @@ -340,15 +340,11 @@ enum plugin_status tidy_do(enum tidy_system system) int tidy_lcd_menu(void) { - int loc, ret = 2; + int selection, ret = 2; bool menu_quit = false; - static const struct menu_item items[] = - { - { "Start Cleaning", NULL }, - { "Files to Clean", NULL }, - { "Quit", NULL } - }; + MENUITEM_STRINGLIST(menu,"Disktidy Menu",NULL,"Start Cleaning", + "Files to Clean","Quit"); static const struct opt_items system_option[3] = { @@ -356,13 +352,11 @@ int tidy_lcd_menu(void) { "Windows", -1 }, { "Both", -1 } }; - - loc = rb->menu_init(items, sizeof(items) / sizeof(*items), - NULL, NULL, NULL, NULL); while (!menu_quit) { - switch(rb->menu_show(loc)) + selection = rb->do_menu(&menu,&selection); + switch(selection) { case 0: @@ -373,13 +367,12 @@ int tidy_lcd_menu(void) rb->set_option("Files to Clean", &ret, INT, system_option, 3, NULL); break; - case 2: + default: ret = 99; /* exit plugin */ menu_quit = true; break; } } - rb->menu_exit(loc); return ret; } -- cgit v1.1