From f0ce1886814d597b5bbe58fe36556356d42b7db6 Mon Sep 17 00:00:00 2001 From: Michael Hohmuth Date: Tue, 8 Feb 2011 20:31:22 +0000 Subject: Make enable-autoresume option more consistent with other settings. Rename "Enable automatic resume" to "Automatic resume", and make it a simple Yes/No option. Offer the user to initialize the database in case it is not yet ready when enabling autoresume. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29249 a1c6a512-1295-4272-9138-f99709370657 --- apps/menus/settings_menu.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'apps/menus') diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index cc3871a4d6..ce03e1a646 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c @@ -34,6 +34,7 @@ #include "tagtree.h" #include "usb.h" #include "splash.h" +#include "yesno.h" #include "talk.h" #include "powermgmt.h" #if CONFIG_CODEC == SWCODEC @@ -426,7 +427,26 @@ MAKE_MENU(hotkey_menu, ID2P(LANG_HOTKEY), 0, Icon_NOICON, #ifdef HAVE_TAGCACHE #if CONFIG_CODEC == SWCODEC -MENUITEM_SETTING(autoresume_enable, &global_settings.autoresume_enable, NULL); +static int autoresume_callback(int action, const struct menu_item_ex *this_item) +{ + (void)this_item; + + if (action == ACTION_EXIT_MENUITEM /* on exit */ + && global_settings.autoresume_enable + && !tagcache_is_usable()) + { + static const char *lines[] = {ID2P(LANG_TAGCACHE_BUSY), + ID2P(LANG_TAGCACHE_FORCE_UPDATE)}; + static const struct text_message message = {lines, 2}; + + if (gui_syncyesno_run(&message, NULL, NULL) == YESNO_YES) + tagcache_rebuild_with_splash(); + } + return action; +} + +MENUITEM_SETTING(autoresume_enable, &global_settings.autoresume_enable, + autoresume_callback); #endif #endif -- cgit v1.2.3