From 6e8ab3d035f8eb0585de636b4f5227b190ff07ee Mon Sep 17 00:00:00 2001 From: Miika Pekkarinen Date: Mon, 25 Sep 2006 19:52:38 +0000 Subject: Honor only the first root_menu setting to make it possible to override the default tagbrowser root menu without modifying the default config. Increased max items in menu to 64 and improved statusbar title. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11050 a1c6a512-1295-4272-9138-f99709370657 --- apps/tagtree.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'apps/tagtree.c') diff --git a/apps/tagtree.c b/apps/tagtree.c index 06239c4458..d992c9e32a 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -115,6 +115,9 @@ struct root_menu { struct menu_entry *items[TAGMENU_MAX_ITEMS]; }; +/* Statusbar text of the current view. */ +static char current_title[MAX_TAGS][128]; + static struct root_menu menus[TAGMENU_MAX_MENUS]; static struct root_menu *menu; static struct search_instruction *csi; @@ -680,6 +683,10 @@ static bool parse_menu(const char *filename) break; case var_rootmenu: + /* Only set root menu once. */ + if (root_menu) + break; + if (get_token_str(data, sizeof(data)) < 0) { logf("%root_menu empty"); @@ -1146,6 +1153,9 @@ int tagtree_enter(struct tree_context* c) csi = menu->items[seek]->si; c->currextra = 0; + strncpy(current_title[c->currextra], dptr->name, + sizeof(current_title[0]) - 1); + /* Read input as necessary. */ for (i = 0; i < csi->tagorder_count; i++) { @@ -1202,6 +1212,10 @@ int tagtree_enter(struct tree_context* c) c->currextra++; else c->dirlevel--; + + /* Update the statusbar title */ + strncpy(current_title[c->currextra], dptr->name, + sizeof(current_title[0]) - 1); break; default: @@ -1421,10 +1435,8 @@ char *tagtree_get_title(struct tree_context* c) return menu->title; case navibrowse: - return (char *)tagcache_tag_to_str(csi->tagorder[c->currextra]); - case allsubentries: - return "Tracks"; + return current_title[c->currextra]; } return "?"; -- cgit v1.2.3