summaryrefslogtreecommitdiff
path: root/apps
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 /apps
parent979c23a71554a480d8a7d7a3996327145ee10d2d (diff)
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
Diffstat (limited to 'apps')
-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 {
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 "?";
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 @@
#include "tree.h"
#define TAGNAVI_VERSION "#! rockbox/tagbrowser/2.0"
-#define TAGMENU_MAX_ITEMS 32
+#define TAGMENU_MAX_ITEMS 64
#define TAGMENU_MAX_MENUS 16
enum table { root = 1, navibrowse, allsubentries, playtrack };