mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-16 08:32:36 -05:00
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
This commit is contained in:
parent
8d38c965dd
commit
a007ebf3b1
1 changed files with 21 additions and 0 deletions
21
apps/tree.c
21
apps/tree.c
|
|
@ -46,6 +46,7 @@
|
||||||
#include "rolo.h"
|
#include "rolo.h"
|
||||||
#include "icons.h"
|
#include "icons.h"
|
||||||
#include "lang.h"
|
#include "lang.h"
|
||||||
|
#include "language.h"
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
#include "widgets.h"
|
#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_MOD 0x200 /* firmware file */
|
||||||
#define TREE_ATTR_EQ 0x400 /* EQ config file */
|
#define TREE_ATTR_EQ 0x400 /* EQ config file */
|
||||||
#define TREE_ATTR_FONT 0x800 /* font 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) */
|
#define TREE_ATTR_MASK 0xffd0 /* which bits tree.c uses (above + DIR) */
|
||||||
|
|
||||||
static int build_playlist(int start_index)
|
static int build_playlist(int start_index)
|
||||||
|
|
@ -253,6 +255,8 @@ static int showdir(char *path, int start)
|
||||||
dptr->attr |= TREE_ATTR_EQ;
|
dptr->attr |= TREE_ATTR_EQ;
|
||||||
else if (!strcasecmp(&entry->d_name[len-4], ".wps"))
|
else if (!strcasecmp(&entry->d_name[len-4], ".wps"))
|
||||||
dptr->attr |= TREE_ATTR_WPS;
|
dptr->attr |= TREE_ATTR_WPS;
|
||||||
|
else if (!strcasecmp(&entry->d_name[len-4], ".lng"))
|
||||||
|
dptr->attr |= TREE_ATTR_LNG;
|
||||||
#ifdef HAVE_RECORDER_KEYPAD
|
#ifdef HAVE_RECORDER_KEYPAD
|
||||||
else if (!strcasecmp(&entry->d_name[len-4], ".fnt"))
|
else if (!strcasecmp(&entry->d_name[len-4], ".fnt"))
|
||||||
dptr->attr |= TREE_ATTR_FONT;
|
dptr->attr |= TREE_ATTR_FONT;
|
||||||
|
|
@ -369,6 +373,10 @@ static int showdir(char *path, int start)
|
||||||
icon_type = Wps;
|
icon_type = Wps;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TREE_ATTR_LNG:
|
||||||
|
icon_type = Wps; /* for now */
|
||||||
|
break;
|
||||||
|
|
||||||
case TREE_ATTR_MOD:
|
case TREE_ATTR_MOD:
|
||||||
icon_type = Mod_Ajz;
|
icon_type = Mod_Ajz;
|
||||||
break;
|
break;
|
||||||
|
|
@ -722,6 +730,13 @@ bool dirbrowse(char *root)
|
||||||
restore = true;
|
restore = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TREE_ATTR_LNG:
|
||||||
|
snprintf(buf, sizeof buf, "%s/%s",
|
||||||
|
currdir, file->name);
|
||||||
|
lang_load(buf);
|
||||||
|
restore = true;
|
||||||
|
break;
|
||||||
|
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
case TREE_ATTR_FONT:
|
case TREE_ATTR_FONT:
|
||||||
snprintf(buf, sizeof buf, "%s/%s",
|
snprintf(buf, sizeof buf, "%s/%s",
|
||||||
|
|
@ -966,3 +981,9 @@ bool dirbrowse(char *root)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -----------------------------------------------------------------
|
||||||
|
* local variables:
|
||||||
|
* eval: (load-file "../firmware/rockbox-mode.el")
|
||||||
|
* end:
|
||||||
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue