diff options
author | Stéphane Doyon <s.doyon@videotron.ca> | 2007-11-03 03:38:54 +0000 |
---|---|---|
committer | Stéphane Doyon <s.doyon@videotron.ca> | 2007-11-03 03:38:54 +0000 |
commit | f6b404bd73818bdf9fd58b1edb61141a6d11af87 (patch) | |
tree | 818c0d19e226d6ff53fcc3eca8d6630b57c657c2 /apps/menus | |
parent | a042c720c3cd0579a77720dad8076a3d33687924 (diff) |
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
Diffstat (limited to 'apps/menus')
-rw-r--r-- | apps/menus/main_menu.c | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index e7c6d6c81a..0a86d1f514 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c @@ -129,8 +129,7 @@ struct info_data unsigned long free2; #endif }; -enum infoscreenorder - +enum infoscreenorder { INFO_BATTERY = 0, 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) { struct info_data *info = (struct info_data*)data; - #if CONFIG_RTC struct tm *tm; - #endif const unsigned char *kbyte_units[] = - { ID2P(LANG_KILOBYTE), 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", global_settings.timeformat == 0 ? tm->tm_hour : tm->tm_hour-12, tm->tm_min, - tm->tm_sec, global_settings.timeformat == 0 ? "" : tm->tm_hour>11 ? "P" : "A"); break; case INFO_DATE: tm = get_time(); snprintf(buffer, MAX_PATH, "%s %d %d", - str(LANG_MONTH_JANUARY + tm->tm_mon), - tm->tm_mday, tm->tm_year+1900); break; @@ -248,8 +241,8 @@ static char* info_getname(int selected_item, void *data, char *buffer) } else { - snprintf(buffer, MAX_PATH, "%s %s %s", str(LANG_DISK_NAME_MMC), - s1, str(LANG_NOT_PRESENT), s2); + snprintf(buffer, MAX_PATH, "%s %s", str(LANG_DISK_NAME_MMC), + str(LANG_NOT_PRESENT)); } #else 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; } + static int info_speak_item(int selected_item, void * 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_GIGABYTE) }; - switch (selected_item) { case INFO_VERSION: /* version */ @@ -276,26 +269,19 @@ static int info_speak_item(int selected_item, void * data) break; #if CONFIG_RTC case INFO_TIME: - talk_id(VOICE_CURRENT_TIME, false); talk_time(get_time(), true); break; case INFO_DATE: talk_date(get_time(), true); - break; #endif case INFO_BUFFER: /* buffer */ - { talk_id(LANG_BUFFER_STAT, false); - long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */ - output_dyn_value(NULL, 0, buflen, kbyte_units, true); - break; - } case INFO_BATTERY: /* battery */ if (battery_level() >= 0) @@ -319,25 +305,28 @@ static int info_speak_item(int selected_item, void * data) } break; case INFO_DISK1: /* disk 1 */ - talk_id(LANG_DISK_FREE_INFO, false); #ifdef HAVE_MULTIVOLUME - talk_id(LANG_DISK_NAME_INTERNAL, true); -#endif + talk_id(LANG_DISK_NAME_INTERNAL, false); + talk_id(LANG_DISK_FREE_INFO, 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; case INFO_DISK2: /* disk 2 */ #ifdef HAVE_MULTIVOLUME + talk_id(LANG_DISK_NAME_MMC, false); if (info->size2) { - talk_id(LANG_DISK_FREE_INFO, false); - talk_id(LANG_DISK_NAME_MMC, true); + talk_id(LANG_DISK_FREE_INFO, 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 - { - talk_id(LANG_DISK_NAME_MMC, false); - talk_id(LANG_NOT_PRESENT, true); - } + else talk_id(LANG_NOT_PRESENT, true); #else talk_id(LANG_DISK_SIZE_INFO, false); output_dyn_value(NULL, 0, info->size, kbyte_units, true); |