From 1e6b227164da279ed83be7f1413880c3553b8614 Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Tue, 19 Sep 2006 12:36:21 +0000 Subject: [PATCH] Properly set list title in tagcache mode and removed one incorrect entry from tagnavi.config. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11001 a1c6a512-1295-4272-9138-f99709370657 --- apps/tagnavi.config | 1 - apps/tagtree.c | 17 +++++++++++++++++ apps/tagtree.h | 1 + apps/tree.c | 23 +++++++++++++++++------ 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/apps/tagnavi.config b/apps/tagnavi.config index 9821c30faf..4d8a4b5847 100644 --- a/apps/tagnavi.config +++ b/apps/tagnavi.config @@ -15,7 +15,6 @@ # Define the search sub menu %menu_start "search" "Search by..." "Artist" -> artist ? artist ~ "" -> album -> title = "%02d. %s" tracknum title -"Artist -> (score > 85)" artist ? artist ~ "" & autoscore >= "85" -> album -> title = "%02d. %s" tracknum title "Album" -> album ? album ~ "" -> title = "%02d. %s" tracknum title "Title" -> title ? title ~ "" "Filename" -> filename ? filename ~ "" diff --git a/apps/tagtree.c b/apps/tagtree.c index 7a710c6fc3..d03623b295 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -1401,6 +1401,23 @@ struct tagentry* tagtree_get_entry(struct tree_context *c, int id) return &entry[realid]; } +char *tagtree_get_title(struct tree_context* c) +{ + switch (c->currtable) + { + case root: + return menu->title; + + case navibrowse: + return (char *)tagcache_tag_to_str(csi->tagorder[c->currextra]); + + case allsubentries: + return "Tracks"; + } + + return "?"; +} + int tagtree_get_attr(struct tree_context* c) { int attr = -1; diff --git a/apps/tagtree.h b/apps/tagtree.h index 0c612ad395..30e00f6c99 100644 --- a/apps/tagtree.h +++ b/apps/tagtree.h @@ -38,6 +38,7 @@ void tagtree_exit(struct tree_context* c); int tagtree_load(struct tree_context* c); struct tagentry* tagtree_get_entry(struct tree_context *c, int id); bool tagtree_insert_selection_playlist(int position, bool queue); +char *tagtree_get_title(struct tree_context* c); int tagtree_get_attr(struct tree_context* c); #ifdef HAVE_LCD_BITMAP const unsigned char* tagtree_get_icon(struct tree_context* c); diff --git a/apps/tree.c b/apps/tree.c index 584aaa8006..4b23bbef89 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -349,7 +349,22 @@ static int update_dir(void) gui_syncsplash(HZ, true, str(LANG_SHOWDIR_BUFFER_FULL)); } } - if (!id3db) { + if (id3db) + { + if (global_settings.show_path_in_browser == SHOW_PATH_FULL + || global_settings.show_path_in_browser == SHOW_PATH_CURRENT) + { + gui_synclist_set_title(&tree_lists, tagtree_get_title(&tc), + filetype_get_icon(ATTR_DIRECTORY)); + } + else + { + /* Must clear the title as the list is reused */ + gui_synclist_set_title(&tree_lists, NULL, NOICON); + } + } + else + { if (global_settings.show_path_in_browser == SHOW_PATH_FULL) { gui_synclist_set_title(&tree_lists, tc.currdir, @@ -373,11 +388,7 @@ static int update_dir(void) gui_synclist_set_title(&tree_lists, NULL, NOICON); } } - else - { - /* This currently doesn't work too well in id3db so turn it off */ - gui_synclist_set_title(&tree_lists, NULL, NOICON); - } + gui_synclist_set_nb_items(&tree_lists, tc.filesindir); gui_synclist_set_icon_callback(&tree_lists, global_settings.show_icons?&tree_get_fileicon:NULL);