diff options
author | Daniel Stenberg <daniel@haxx.se> | 2002-09-24 12:40:52 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2002-09-24 12:40:52 +0000 |
commit | a007ebf3b15d791a03d259bc14d590f4f09ae489 (patch) | |
tree | 23f7080cf6cd1dfd3d3918157638940d3b21fedf /apps | |
parent | 8d38c965ddbb0cd34189626a0002d33f1a9d1d2d (diff) | |
download | rockbox-a007ebf3b15d791a03d259bc14d590f4f09ae489.tar.gz rockbox-a007ebf3b15d791a03d259bc14d590f4f09ae489.zip |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/tree.c | 21 |
1 files changed, 21 insertions, 0 deletions
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 @@ | |||
46 | #include "rolo.h" | 46 | #include "rolo.h" |
47 | #include "icons.h" | 47 | #include "icons.h" |
48 | #include "lang.h" | 48 | #include "lang.h" |
49 | #include "language.h" | ||
49 | 50 | ||
50 | #ifdef HAVE_LCD_BITMAP | 51 | #ifdef HAVE_LCD_BITMAP |
51 | #include "widgets.h" | 52 | #include "widgets.h" |
@@ -139,6 +140,7 @@ extern unsigned char bitmap_icons_6x8[LastIcon][6]; | |||
139 | #define TREE_ATTR_MOD 0x200 /* firmware file */ | 140 | #define TREE_ATTR_MOD 0x200 /* firmware file */ |
140 | #define TREE_ATTR_EQ 0x400 /* EQ config file */ | 141 | #define TREE_ATTR_EQ 0x400 /* EQ config file */ |
141 | #define TREE_ATTR_FONT 0x800 /* font file */ | 142 | #define TREE_ATTR_FONT 0x800 /* font file */ |
143 | #define TREE_ATTR_LNG 0x1000 /* binary lang file */ | ||
142 | #define TREE_ATTR_MASK 0xffd0 /* which bits tree.c uses (above + DIR) */ | 144 | #define TREE_ATTR_MASK 0xffd0 /* which bits tree.c uses (above + DIR) */ |
143 | 145 | ||
144 | static int build_playlist(int start_index) | 146 | static int build_playlist(int start_index) |
@@ -253,6 +255,8 @@ static int showdir(char *path, int start) | |||
253 | dptr->attr |= TREE_ATTR_EQ; | 255 | dptr->attr |= TREE_ATTR_EQ; |
254 | else if (!strcasecmp(&entry->d_name[len-4], ".wps")) | 256 | else if (!strcasecmp(&entry->d_name[len-4], ".wps")) |
255 | dptr->attr |= TREE_ATTR_WPS; | 257 | dptr->attr |= TREE_ATTR_WPS; |
258 | else if (!strcasecmp(&entry->d_name[len-4], ".lng")) | ||
259 | dptr->attr |= TREE_ATTR_LNG; | ||
256 | #ifdef HAVE_RECORDER_KEYPAD | 260 | #ifdef HAVE_RECORDER_KEYPAD |
257 | else if (!strcasecmp(&entry->d_name[len-4], ".fnt")) | 261 | else if (!strcasecmp(&entry->d_name[len-4], ".fnt")) |
258 | dptr->attr |= TREE_ATTR_FONT; | 262 | dptr->attr |= TREE_ATTR_FONT; |
@@ -369,6 +373,10 @@ static int showdir(char *path, int start) | |||
369 | icon_type = Wps; | 373 | icon_type = Wps; |
370 | break; | 374 | break; |
371 | 375 | ||
376 | case TREE_ATTR_LNG: | ||
377 | icon_type = Wps; /* for now */ | ||
378 | break; | ||
379 | |||
372 | case TREE_ATTR_MOD: | 380 | case TREE_ATTR_MOD: |
373 | icon_type = Mod_Ajz; | 381 | icon_type = Mod_Ajz; |
374 | break; | 382 | break; |
@@ -722,6 +730,13 @@ bool dirbrowse(char *root) | |||
722 | restore = true; | 730 | restore = true; |
723 | break; | 731 | break; |
724 | 732 | ||
733 | case TREE_ATTR_LNG: | ||
734 | snprintf(buf, sizeof buf, "%s/%s", | ||
735 | currdir, file->name); | ||
736 | lang_load(buf); | ||
737 | restore = true; | ||
738 | break; | ||
739 | |||
725 | #ifdef HAVE_LCD_BITMAP | 740 | #ifdef HAVE_LCD_BITMAP |
726 | case TREE_ATTR_FONT: | 741 | case TREE_ATTR_FONT: |
727 | snprintf(buf, sizeof buf, "%s/%s", | 742 | snprintf(buf, sizeof buf, "%s/%s", |
@@ -966,3 +981,9 @@ bool dirbrowse(char *root) | |||
966 | 981 | ||
967 | return false; | 982 | return false; |
968 | } | 983 | } |
984 | |||
985 | /* ----------------------------------------------------------------- | ||
986 | * local variables: | ||
987 | * eval: (load-file "../firmware/rockbox-mode.el") | ||
988 | * end: | ||
989 | */ | ||