summaryrefslogtreecommitdiff
path: root/apps/plugins/disktidy.c
diff options
context:
space:
mode:
authorTom Ross <midgey@rockbox.org>2007-03-28 07:33:18 +0000
committerTom Ross <midgey@rockbox.org>2007-03-28 07:33:18 +0000
commitc7f5cccd3e061c8a53e919d117a2adb3fe58473b (patch)
treec65e1f2c13e07bcf9169d098e5b29f3f2727d7a6 /apps/plugins/disktidy.c
parenta289324e30c78db7b333d461aca5554f6ecf9cfe (diff)
downloadrockbox-c7f5cccd3e061c8a53e919d117a2adb3fe58473b.zip
rockbox-c7f5cccd3e061c8a53e919d117a2adb3fe58473b.tar.gz
rockbox-c7f5cccd3e061c8a53e919d117a2adb3fe58473b.tar.bz2
rockbox-c7f5cccd3e061c8a53e919d117a2adb3fe58473b.tar.xz
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
Diffstat (limited to 'apps/plugins/disktidy.c')
-rw-r--r--apps/plugins/disktidy.c19
1 files changed, 6 insertions, 13 deletions
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;
}