summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-09-25 19:52:38 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-09-25 19:52:38 +0000
commit6e8ab3d035f8eb0585de636b4f5227b190ff07ee (patch)
tree1fca709fb6b4508ae8f8b33ca3b41170494771f1
parent979c23a71554a480d8a7d7a3996327145ee10d2d (diff)
downloadrockbox-6e8ab3d035f8eb0585de636b4f5227b190ff07ee.tar.gz
rockbox-6e8ab3d035f8eb0585de636b4f5227b190ff07ee.zip
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
-rw-r--r--apps/tagtree.c18
-rw-r--r--apps/tagtree.h2
2 files changed, 16 insertions, 4 deletions
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 {
115 struct menu_entry *items[TAGMENU_MAX_ITEMS]; 115 struct menu_entry *items[TAGMENU_MAX_ITEMS];
116}; 116};
117 117
118/* Statusbar text of the current view. */
119static char current_title[MAX_TAGS][128];
120
118static struct root_menu menus[TAGMENU_MAX_MENUS]; 121static struct root_menu menus[TAGMENU_MAX_MENUS];
119static struct root_menu *menu; 122static struct root_menu *menu;
120static struct search_instruction *csi; 123static struct search_instruction *csi;
@@ -680,6 +683,10 @@ static bool parse_menu(const char *filename)
680 break; 683 break;
681 684
682 case var_rootmenu: 685 case var_rootmenu:
686 /* Only set root menu once. */
687 if (root_menu)
688 break;
689
683 if (get_token_str(data, sizeof(data)) < 0) 690 if (get_token_str(data, sizeof(data)) < 0)
684 { 691 {
685 logf("%root_menu empty"); 692 logf("%root_menu empty");
@@ -1146,6 +1153,9 @@ int tagtree_enter(struct tree_context* c)
1146 csi = menu->items[seek]->si; 1153 csi = menu->items[seek]->si;
1147 c->currextra = 0; 1154 c->currextra = 0;
1148 1155
1156 strncpy(current_title[c->currextra], dptr->name,
1157 sizeof(current_title[0]) - 1);
1158
1149 /* Read input as necessary. */ 1159 /* Read input as necessary. */
1150 for (i = 0; i < csi->tagorder_count; i++) 1160 for (i = 0; i < csi->tagorder_count; i++)
1151 { 1161 {
@@ -1202,6 +1212,10 @@ int tagtree_enter(struct tree_context* c)
1202 c->currextra++; 1212 c->currextra++;
1203 else 1213 else
1204 c->dirlevel--; 1214 c->dirlevel--;
1215
1216 /* Update the statusbar title */
1217 strncpy(current_title[c->currextra], dptr->name,
1218 sizeof(current_title[0]) - 1);
1205 break; 1219 break;
1206 1220
1207 default: 1221 default:
@@ -1421,10 +1435,8 @@ char *tagtree_get_title(struct tree_context* c)
1421 return menu->title; 1435 return menu->title;
1422 1436
1423 case navibrowse: 1437 case navibrowse:
1424 return (char *)tagcache_tag_to_str(csi->tagorder[c->currextra]);
1425
1426 case allsubentries: 1438 case allsubentries:
1427 return "Tracks"; 1439 return current_title[c->currextra];
1428 } 1440 }
1429 1441
1430 return "?"; 1442 return "?";
diff --git a/apps/tagtree.h b/apps/tagtree.h
index f3f1103d90..9f570917f7 100644
--- a/apps/tagtree.h
+++ b/apps/tagtree.h
@@ -23,7 +23,7 @@
23#include "tree.h" 23#include "tree.h"
24 24
25#define TAGNAVI_VERSION "#! rockbox/tagbrowser/2.0" 25#define TAGNAVI_VERSION "#! rockbox/tagbrowser/2.0"
26#define TAGMENU_MAX_ITEMS 32 26#define TAGMENU_MAX_ITEMS 64
27#define TAGMENU_MAX_MENUS 16 27#define TAGMENU_MAX_MENUS 16
28 28
29enum table { root = 1, navibrowse, allsubentries, playtrack }; 29enum table { root = 1, navibrowse, allsubentries, playtrack };