summaryrefslogtreecommitdiffstats
path: root/apps/menus/settings_menu.c
diff options
context:
space:
mode:
authorMichael Hohmuth <sideral@rockbox.org>2011-02-08 20:31:22 +0000
committerMichael Hohmuth <sideral@rockbox.org>2011-02-08 20:31:22 +0000
commitf0ce1886814d597b5bbe58fe36556356d42b7db6 (patch)
treed97172e9bcbe4246455bfd3ea55d417126dde92b /apps/menus/settings_menu.c
parent5f037ac015e6d76d030a163753db5ff58cdff49b (diff)
downloadrockbox-f0ce1886814d597b5bbe58fe36556356d42b7db6.tar.gz
rockbox-f0ce1886814d597b5bbe58fe36556356d42b7db6.zip
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
Diffstat (limited to 'apps/menus/settings_menu.c')
-rw-r--r--apps/menus/settings_menu.c22
1 files changed, 21 insertions, 1 deletions
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