From 7e63d80117fdc6dbaaf86f6f016ac65de41c3225 Mon Sep 17 00:00:00 2001 From: funman Date: Sun, 1 Nov 2009 22:48:46 +0000 Subject: [PATCH] new skin token: %cx - 24 hour time format enabled in the setting.. e.g %?cx<24 hour|12 hour> git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23474 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/skin_engine/skin_parser.c | 1 + apps/gui/skin_engine/skin_tokens.c | 6 ++++++ apps/gui/skin_engine/skin_tokens.h | 1 + wps/classic_statusbar.sbs | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index c05ebca45..26ccf4733 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -200,6 +200,7 @@ static const struct wps_tag all_tags[] = { #endif { WPS_TOKEN_RTC_PRESENT , "cc", WPS_REFRESH_STATIC, NULL }, + { WPS_TOKEN_RTC_24HR_SETTING_MODE, "cx", 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 }, diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index 46adbdc09..6dbceca90 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -569,6 +569,12 @@ const char *get_token_value(struct gui_wps *gwps, #else return NULL; #endif + case WPS_TOKEN_RTC_24HR_SETTING_MODE: +#if CONFIG_RTC + return global_settings.timeformat?NULL:"z"; +#else + return NULL; +#endif #if CONFIG_RTC case WPS_TOKEN_RTC_12HOUR_CFG: diff --git a/apps/gui/skin_engine/skin_tokens.h b/apps/gui/skin_engine/skin_tokens.h index 6d783551e..5f35afc27 100644 --- a/apps/gui/skin_engine/skin_tokens.h +++ b/apps/gui/skin_engine/skin_tokens.h @@ -62,6 +62,7 @@ enum wps_token_type { /* Time */ WPS_TOKEN_RTC_PRESENT, + WPS_TOKEN_RTC_24HR_SETTING_MODE, /* 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/wps/classic_statusbar.sbs b/wps/classic_statusbar.sbs index 953b9a4a0..c867672e4 100644 --- a/wps/classic_statusbar.sbs +++ b/wps/classic_statusbar.sbs @@ -63,7 +63,7 @@ # Clock on RTC able targets, and disk access %V|-36|0|-6|8|0|-|-| # align on the right with room for 6 SYSFONT digits -%?cc<%?ca<%?St|time format|<%cH|%cI>:%cM|--:-->|> +%?cc<%?ca<%?cx<%cH|%cI>:%cM|--:-->|> # disk access "icon" %V|-6|0|-|8|0|-|-| # align on the right with room for 1 SYSFONT digit %?lh<*|> -- 2.11.4.GIT