From e435e4d976757f8436484a5b4d158ab7545fcdb6 Mon Sep 17 00:00:00 2001 From: Marianne Arnold Date: Sat, 16 May 2009 11:22:41 +0000 Subject: New 'clock present' WPS tag: The tag checks for the presence of the clock hardware and can be used unconditionally (returning a 'c') or in a conditional. You can specify what to display if a target has the clock (the true case) and an alternative for targets without. This can be useful for e.g. the greyscale 160x128 WPSs or the Archos ones which work on players with and without the hardware. - Add the new tag to the WPS tag description in the manual. Change the headline to the less technical 'Time and Date' as per the discussion in IRC. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20961 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/gwps-common.c | 8 ++++++++ apps/gui/gwps.h | 2 ++ apps/gui/wps_parser.c | 1 + 3 files changed, 11 insertions(+) (limited to 'apps/gui') diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index 1fef9e02cb..9a69c74bf3 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c @@ -1037,6 +1037,14 @@ static const char *get_token_value(struct gui_wps *gwps, *intval = global_settings.repeat_mode + 1; snprintf(buf, buf_size, "%d", global_settings.repeat_mode); return buf; + + case WPS_TOKEN_RTC_PRESENT: +#if CONFIG_RTC + return "c"; +#else + return NULL; +#endif + #if CONFIG_RTC case WPS_TOKEN_RTC_12HOUR_CFG: if (intval) diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h index 935e015c93..f3562214a0 100644 --- a/apps/gui/gwps.h +++ b/apps/gui/gwps.h @@ -173,6 +173,8 @@ enum wps_token_type { /* Time */ + WPS_TOKEN_RTC_PRESENT, + /* The begin/end values allow us to know if a token is an RTC one. New RTC tokens should be added between the markers. */ diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index 70e13e78a7..7211e6c86a 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c @@ -193,6 +193,7 @@ static const struct wps_tag all_tags[] = { { WPS_TOKEN_BATTERY_CHARGER_CONNECTED,"bp", WPS_REFRESH_DYNAMIC, NULL }, #endif + { WPS_TOKEN_RTC_PRESENT , "cc", WPS_REFRESH_STATIC, NULL }, { WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_RTC_REFRESH, NULL }, { WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,"ce", WPS_RTC_REFRESH, NULL }, { WPS_TOKEN_RTC_12HOUR_CFG, "cf", WPS_RTC_REFRESH, NULL }, -- cgit v1.2.3