From a007ebf3b15d791a03d259bc14d590f4f09ae489 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 24 Sep 2002 12:40:52 +0000 Subject: use the language load function for .lng files, oooh this is fun! ;-) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2389 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/apps/tree.c b/apps/tree.c index d3ee244ff6..7aaea691a0 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -46,6 +46,7 @@ #include "rolo.h" #include "icons.h" #include "lang.h" +#include "language.h" #ifdef HAVE_LCD_BITMAP #include "widgets.h" @@ -139,6 +140,7 @@ extern unsigned char bitmap_icons_6x8[LastIcon][6]; #define TREE_ATTR_MOD 0x200 /* firmware file */ #define TREE_ATTR_EQ 0x400 /* EQ config file */ #define TREE_ATTR_FONT 0x800 /* font file */ +#define TREE_ATTR_LNG 0x1000 /* binary lang file */ #define TREE_ATTR_MASK 0xffd0 /* which bits tree.c uses (above + DIR) */ static int build_playlist(int start_index) @@ -253,6 +255,8 @@ static int showdir(char *path, int start) dptr->attr |= TREE_ATTR_EQ; else if (!strcasecmp(&entry->d_name[len-4], ".wps")) dptr->attr |= TREE_ATTR_WPS; + else if (!strcasecmp(&entry->d_name[len-4], ".lng")) + dptr->attr |= TREE_ATTR_LNG; #ifdef HAVE_RECORDER_KEYPAD else if (!strcasecmp(&entry->d_name[len-4], ".fnt")) dptr->attr |= TREE_ATTR_FONT; @@ -369,6 +373,10 @@ static int showdir(char *path, int start) icon_type = Wps; break; + case TREE_ATTR_LNG: + icon_type = Wps; /* for now */ + break; + case TREE_ATTR_MOD: icon_type = Mod_Ajz; break; @@ -722,6 +730,13 @@ bool dirbrowse(char *root) restore = true; break; + case TREE_ATTR_LNG: + snprintf(buf, sizeof buf, "%s/%s", + currdir, file->name); + lang_load(buf); + restore = true; + break; + #ifdef HAVE_LCD_BITMAP case TREE_ATTR_FONT: snprintf(buf, sizeof buf, "%s/%s", @@ -966,3 +981,9 @@ bool dirbrowse(char *root) return false; } + +/* ----------------------------------------------------------------- + * local variables: + * eval: (load-file "../firmware/rockbox-mode.el") + * end: + */ -- cgit v1.2.3