Info screen fixups:

* Shortened the voice entry for external disk names.
* Deprecated LANG_CURRENT_TIME which is not used anywhere.
* Before there were CRLFs, then there were blank lines, cleaned that up.
* Removed extra format specifier and args in the snprintf for MMC NOT_PRESENT.
* Made the voice info about disks match more closely what is displayed:
  basically, speak disk size for multi-volume case as well.
* Not too sure about the reordering, so I did NOT touch that.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15415 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Stéphane Doyon 2007-11-03 03:38:54 +00:00
parent a042c720c3
commit f6b404bd73
2 changed files with 23 additions and 34 deletions

View file

@ -6962,8 +6962,8 @@
</dest> </dest>
<voice> <voice>
*: none *: none
e200,c200: "micro Secure Digital card:" e200,c200: "micro S D"
ondio*: "Multimedia card" ondio*: "M M C"
</voice> </voice>
</phrase> </phrase>
<phrase> <phrase>
@ -6996,16 +6996,16 @@
</phrase> </phrase>
<phrase> <phrase>
id: LANG_CURRENT_TIME id: LANG_CURRENT_TIME
desc: in run time screen desc: deprecated
user: user:
<source> <source>
*: "Current Time" *: ""
</source> </source>
<dest> <dest>
*: "Current Time" *: ""
</dest> </dest>
<voice> <voice>
*: "Current Time" *: ""
</voice> </voice>
</phrase> </phrase>
<phrase> <phrase>

View file

@ -129,8 +129,7 @@ struct info_data
unsigned long free2; unsigned long free2;
#endif #endif
}; };
enum infoscreenorder enum infoscreenorder
{ {
INFO_BATTERY = 0, INFO_BATTERY = 0,
INFO_DISK1, /* capacity or internal capacity/free on hotswap */ INFO_DISK1, /* capacity or internal capacity/free on hotswap */
@ -148,13 +147,10 @@ enum infoscreenorder
static char* info_getname(int selected_item, void *data, char *buffer) static char* info_getname(int selected_item, void *data, char *buffer)
{ {
struct info_data *info = (struct info_data*)data; struct info_data *info = (struct info_data*)data;
#if CONFIG_RTC #if CONFIG_RTC
struct tm *tm; struct tm *tm;
#endif #endif
const unsigned char *kbyte_units[] = const unsigned char *kbyte_units[] =
{ {
ID2P(LANG_KILOBYTE), ID2P(LANG_KILOBYTE),
ID2P(LANG_MEGABYTE), ID2P(LANG_MEGABYTE),
@ -187,16 +183,13 @@ static char* info_getname(int selected_item, void *data, char *buffer)
snprintf(buffer, MAX_PATH, "%02d:%02d:%02d %s", snprintf(buffer, MAX_PATH, "%02d:%02d:%02d %s",
global_settings.timeformat == 0 ? tm->tm_hour : tm->tm_hour-12, global_settings.timeformat == 0 ? tm->tm_hour : tm->tm_hour-12,
tm->tm_min, tm->tm_min,
tm->tm_sec, tm->tm_sec,
global_settings.timeformat == 0 ? "" : tm->tm_hour>11 ? "P" : "A"); global_settings.timeformat == 0 ? "" : tm->tm_hour>11 ? "P" : "A");
break; break;
case INFO_DATE: case INFO_DATE:
tm = get_time(); tm = get_time();
snprintf(buffer, MAX_PATH, "%s %d %d", snprintf(buffer, MAX_PATH, "%s %d %d",
str(LANG_MONTH_JANUARY + tm->tm_mon), str(LANG_MONTH_JANUARY + tm->tm_mon),
tm->tm_mday, tm->tm_mday,
tm->tm_year+1900); tm->tm_year+1900);
break; break;
@ -248,8 +241,8 @@ static char* info_getname(int selected_item, void *data, char *buffer)
} }
else else
{ {
snprintf(buffer, MAX_PATH, "%s %s %s", str(LANG_DISK_NAME_MMC), snprintf(buffer, MAX_PATH, "%s %s", str(LANG_DISK_NAME_MMC),
s1, str(LANG_NOT_PRESENT), s2); str(LANG_NOT_PRESENT));
} }
#else #else
output_dyn_value(s1, sizeof s1, info->size, kbyte_units, true); output_dyn_value(s1, sizeof s1, info->size, kbyte_units, true);
@ -259,6 +252,7 @@ static char* info_getname(int selected_item, void *data, char *buffer)
} }
return buffer; return buffer;
} }
static int info_speak_item(int selected_item, void * data) static int info_speak_item(int selected_item, void * data)
{ {
struct info_data *info = (struct info_data*)data; struct info_data *info = (struct info_data*)data;
@ -267,7 +261,6 @@ static int info_speak_item(int selected_item, void * data)
ID2P(LANG_MEGABYTE), ID2P(LANG_MEGABYTE),
ID2P(LANG_GIGABYTE) ID2P(LANG_GIGABYTE)
}; };
switch (selected_item) switch (selected_item)
{ {
case INFO_VERSION: /* version */ case INFO_VERSION: /* version */
@ -276,26 +269,19 @@ static int info_speak_item(int selected_item, void * data)
break; break;
#if CONFIG_RTC #if CONFIG_RTC
case INFO_TIME: case INFO_TIME:
talk_id(VOICE_CURRENT_TIME, false); talk_id(VOICE_CURRENT_TIME, false);
talk_time(get_time(), true); talk_time(get_time(), true);
break; break;
case INFO_DATE: case INFO_DATE:
talk_date(get_time(), true); talk_date(get_time(), true);
break; break;
#endif #endif
case INFO_BUFFER: /* buffer */ case INFO_BUFFER: /* buffer */
{ {
talk_id(LANG_BUFFER_STAT, false); talk_id(LANG_BUFFER_STAT, false);
long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */ long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */
output_dyn_value(NULL, 0, buflen, kbyte_units, true); output_dyn_value(NULL, 0, buflen, kbyte_units, true);
break; break;
} }
case INFO_BATTERY: /* battery */ case INFO_BATTERY: /* battery */
if (battery_level() >= 0) if (battery_level() >= 0)
@ -319,25 +305,28 @@ static int info_speak_item(int selected_item, void * data)
} }
break; break;
case INFO_DISK1: /* disk 1 */ case INFO_DISK1: /* disk 1 */
talk_id(LANG_DISK_FREE_INFO, false);
#ifdef HAVE_MULTIVOLUME #ifdef HAVE_MULTIVOLUME
talk_id(LANG_DISK_NAME_INTERNAL, true); talk_id(LANG_DISK_NAME_INTERNAL, false);
#endif talk_id(LANG_DISK_FREE_INFO, true);
output_dyn_value(NULL, 0, info->free, kbyte_units, true); output_dyn_value(NULL, 0, info->free, kbyte_units, true);
talk_id(LANG_DISK_SIZE_INFO, true);
output_dyn_value(NULL, 0, info->size, kbyte_units, true);
#else
talk_id(LANG_DISK_FREE_INFO, false);
output_dyn_value(NULL, 0, info->free, kbyte_units, true);
#endif
break; break;
case INFO_DISK2: /* disk 2 */ case INFO_DISK2: /* disk 2 */
#ifdef HAVE_MULTIVOLUME #ifdef HAVE_MULTIVOLUME
talk_id(LANG_DISK_NAME_MMC, false);
if (info->size2) if (info->size2)
{ {
talk_id(LANG_DISK_FREE_INFO, false); talk_id(LANG_DISK_FREE_INFO, true);
talk_id(LANG_DISK_NAME_MMC, true);
output_dyn_value(NULL, 0, info->free2, kbyte_units, true); output_dyn_value(NULL, 0, info->free2, kbyte_units, true);
talk_id(LANG_DISK_SIZE_INFO, true);
output_dyn_value(NULL, 0, info->size2, kbyte_units, true);
} }
else else talk_id(LANG_NOT_PRESENT, true);
{
talk_id(LANG_DISK_NAME_MMC, false);
talk_id(LANG_NOT_PRESENT, true);
}
#else #else
talk_id(LANG_DISK_SIZE_INFO, false); talk_id(LANG_DISK_SIZE_INFO, false);
output_dyn_value(NULL, 0, info->size, kbyte_units, true); output_dyn_value(NULL, 0, info->size, kbyte_units, true);