diff options
author | Jens Arnold <amiconn@rockbox.org> | 2005-05-06 18:12:16 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2005-05-06 18:12:16 +0000 |
commit | cb28941c8c512dc8cbee0590518b5132f7ddc736 (patch) | |
tree | 8f6ee78798fa6f4885aac42c6c871b4a9af3d97c /apps | |
parent | dc405cc03f66c0f9dacbe83a66cf99f325cbaf98 (diff) |
Ondio: Better disk information (multivolume support).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6408 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/deutsch.lang | 14 | ||||
-rw-r--r-- | apps/lang/english.lang | 14 | ||||
-rw-r--r-- | apps/main_menu.c | 55 |
3 files changed, 71 insertions, 12 deletions
diff --git a/apps/lang/deutsch.lang b/apps/lang/deutsch.lang index 1c625d15f5..0e718c2f56 100644 --- a/apps/lang/deutsch.lang +++ b/apps/lang/deutsch.lang @@ -3080,4 +3080,16 @@ id: LANG_LCD_REMOTE_MENU desc: in the display sub menu eng: "Remote-LCD Einstellungen" voice: "" -new:
\ No newline at end of file +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:" diff --git a/apps/lang/english.lang b/apps/lang/english.lang index bc688a3115..423215c830 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -3074,4 +3074,16 @@ id: LANG_LCD_REMOTE_MENU desc: in the display sub menu eng: "Remote-LCD Settings" voice: "" -new:
\ No newline at end of file +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: diff --git a/apps/main_menu.c b/apps/main_menu.c index d530f4bd74..e1bf424d36 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c @@ -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 { @@ -217,7 +243,7 @@ bool show_info(void) integer, decimal); #endif lcd_puts(0, y++, s); - + #ifdef HAVE_CHARGE_CTRL if (charge_state == 1) snprintf(s, sizeof(s), str(LANG_BATTERY_CHARGE)); @@ -236,21 +262,30 @@ 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); +#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 - snprintf(s, sizeof s, "%s %s", str(LANG_DISK_FREE_INFO), s2); -#endif + 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(); |