summaryrefslogtreecommitdiffstats
path: root/apps/menus
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2012-07-18 23:36:57 +0200
committerThomas Martitz <kugel@rockbox.org>2012-07-30 21:20:51 +0200
commit63d27626e417f0e80b649ca366e79ba92473a6d4 (patch)
treeb52d8bafc7d47279af5b763876121b63790324d6 /apps/menus
parent0a645d212c226da8f85b23125fb192fb94829628 (diff)
downloadrockbox-63d27626e417f0e80b649ca366e79ba92473a6d4.tar.gz
rockbox-63d27626e417f0e80b649ca366e79ba92473a6d4.tar.bz2
rockbox-63d27626e417f0e80b649ca366e79ba92473a6d4.zip
Database: Support for multiple search roots.
Support multiple roots (i.e. scan folders) using the new folder_select() function. Amaximum of 12 dirs can be selected, however the setting (i.e. the entire folder list) cannot be longer than 80 chars. The setting works similar to the autoresume dirs: Directories are seperated by colons, e.g. "/Music:/Podcasts". Default is "/sdcard" on android, "/" on all other targets. Changes are made to the multiple-root logic in tagcache.c. This is to a) provide the logic at all on native targets and b) support more than one root before the scan even starts (until now it was used to add roots during scan due to symlinks). Change-Id: I64992c0678324536e8e64cd4427c8abbd8e8b39e
Diffstat (limited to 'apps/menus')
-rw-r--r--apps/menus/settings_menu.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c
index 495040d177..f2249e3a57 100644
--- a/apps/menus/settings_menu.c
+++ b/apps/menus/settings_menu.c
@@ -66,6 +66,21 @@ static void tagcache_update_with_splash(void)
splash(HZ*2, ID2P(LANG_TAGCACHE_FORCE_UPDATE_SPLASH));
}
+static int dirs_to_scan(void)
+{
+ if (folder_select(global_settings.tagcache_scan_paths,
+ sizeof(global_settings.tagcache_scan_paths)))
+ {
+ 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 0;
+}
+
#ifdef HAVE_TC_RAMCACHE
MENUITEM_SETTING(tagcache_ram, &global_settings.tagcache_ram, NULL);
#endif
@@ -83,12 +98,16 @@ MENUITEM_FUNCTION(tc_export, 0, ID2P(LANG_TAGCACHE_EXPORT),
MENUITEM_FUNCTION(tc_import, 0, ID2P(LANG_TAGCACHE_IMPORT),
(int(*)(void))tagtree_import, NULL,
NULL, Icon_NOICON);
+MENUITEM_FUNCTION(tc_paths, 0, ID2P(LANG_SELECT_DATABASE_DIRS),
+ dirs_to_scan, NULL, NULL, Icon_NOICON);
+
MAKE_MENU(tagcache_menu, ID2P(LANG_TAGCACHE), 0, Icon_NOICON,
#ifdef HAVE_TC_RAMCACHE
&tagcache_ram,
#endif
&tagcache_autoupdate, &tc_init, &tc_update, &runtimedb,
- &tc_export, &tc_import);
+ &tc_export, &tc_import, &tc_paths
+ );
#endif /* HAVE_TAGCACHE */
/* TAGCACHE MENU */
/***********************************/