1
0
Fork 0
forked from len0rd/rockbox

Ondio: Better disk information (multivolume support).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6408 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2005-05-06 18:12:16 +00:00
parent dc405cc03f
commit cb28941c8c
3 changed files with 71 additions and 12 deletions

View file

@ -3081,3 +3081,15 @@ desc: in the display sub menu
eng: "Remote-LCD Einstellungen"
voice: ""
new:
id: LANG_DISK_NAME_INTERNAL
desc: in info menu; name for internal disk with multivolume (keep short!)
eng: "Int:"
voice: "Intern"
new: "Int:"
id: LANG_DISK_NAME_MMC
desc: in info menu; name for external disk with multivolume (Ondio; keep short!)
eng: "MMC:"
voice: "Multimediakarte"
new: "MMC:"

View file

@ -3075,3 +3075,15 @@ desc: in the display sub menu
eng: "Remote-LCD Settings"
voice: ""
new:
id: LANG_DISK_NAME_INTERNAL
desc: in info menu; name for internal disk with multivolume (keep short!)
eng: "Int:"
voice: "Internal"
new:
id: LANG_DISK_NAME_MMC
desc: in info menu; name for external disk with multivolume (Ondio; keep short!)
eng: "MMC:"
voice: "Multimedia card"
new:

View file

@ -151,15 +151,27 @@ bool show_credits(void)
#ifdef SIMULATOR
extern bool simulate_usb(void);
#endif
#ifdef HAVE_LCD_CHARCELLS
#define SIZE_FMT "%s%s"
#else
#define SIZE_FMT "%s %s"
#endif
bool show_info(void)
{
char s[32], s2[32];
char s[32], s1[32];
long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */
int integer, decimal;
bool done = false;
int key;
int state = 1;
unsigned long size, free;
#ifdef HAVE_MULTIVOLUME
char s2[32];
unsigned long size2 = 0;
unsigned long free2 = 0;
#endif
const unsigned char *kbyte_units[] = {
ID2P(LANG_KILOBYTE),
@ -168,6 +180,10 @@ bool show_info(void)
};
fat_size( IF_MV2(0,) &size, &free );
#ifdef HAVE_MULTIVOLUME
if (fat_ismounted(1))
fat_size( 1, &size2, &free2 );
#endif
if (global_settings.talk_menu)
{ /* say whatever is reasonable, no real connection to the screen */
@ -180,7 +196,17 @@ bool show_info(void)
}
talk_id(LANG_DISK_FREE_INFO, enqueue);
#ifdef HAVE_MULTIVOLUME
talk_id(LANG_DISK_NAME_INTERNAL, true);
output_dyn_value(NULL, 0, free, kbyte_units, true);
if (size2)
{
talk_id(LANG_DISK_NAME_MMC, true);
output_dyn_value(NULL, 0, free2, kbyte_units, true);
}
#else
output_dyn_value(NULL, 0, free, kbyte_units, true); /* NULL == talk */
#endif
#ifdef HAVE_RTC
{
@ -236,22 +262,31 @@ bool show_info(void)
}
if (state & 2) {
#ifdef HAVE_MULTIVOLUME
output_dyn_value(s1, sizeof s1, free, kbyte_units, true);
output_dyn_value(s2, sizeof s2, size, kbyte_units, true);
#ifdef HAVE_LCD_CHARCELLS
snprintf(s, sizeof s, "%s%s", str(LANG_DISK_SIZE_INFO), s2);
snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_INTERNAL),
s1, s2);
#else
snprintf(s, sizeof s, "%s %s", str(LANG_DISK_SIZE_INFO), s2);
output_dyn_value(s1, sizeof s1, size, kbyte_units, true);
snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_SIZE_INFO), s1);
#endif
lcd_puts(0, y++, s);
output_dyn_value(s2, sizeof s2, free, kbyte_units, true);
#ifdef HAVE_LCD_CHARCELLS
snprintf(s, sizeof s, "%s%s", str(LANG_DISK_FREE_INFO), s2);
#else
snprintf(s, sizeof s, "%s %s", str(LANG_DISK_FREE_INFO), s2);
#endif
#ifdef HAVE_MULTIVOLUME
if (size2) {
output_dyn_value(s1, sizeof s1, free2, kbyte_units, true);
output_dyn_value(s2, sizeof s2, size2, kbyte_units, true);
snprintf(s, sizeof s, "%s %s/%s", str(LANG_DISK_NAME_MMC),
s1, s2);
lcd_puts(0, y++, s);
}
#else
output_dyn_value(s1, sizeof s1, free, kbyte_units, true);
snprintf(s, sizeof s, SIZE_FMT, str(LANG_DISK_FREE_INFO), s1);
lcd_puts(0, y++, s);
#endif
}
lcd_update();
/* Wait for a key to be pushed */