summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2007-11-27 01:18:31 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2007-11-27 01:18:31 +0000
commit0ade09bd6b14f4c27d28d055306ccd63569f5c49 (patch)
treea9fa7234a0b6266f9ef78d6e58e2366cdd85b869
parent7034237dbbf0e4900e96d5f530b0f587b0289a59 (diff)
downloadrockbox-0ade09bd6b14f4c27d28d055306ccd63569f5c49.tar.gz
rockbox-0ade09bd6b14f4c27d28d055306ccd63569f5c49.zip
add 2 new tags which display the hour in 12 or 24 hour format depending on the config setting.
%cf is for padded hour %cg is for just the number git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15826 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/gwps-common.c18
-rw-r--r--apps/gui/gwps.h2
-rw-r--r--apps/gui/wps_parser.c2
3 files changed, 21 insertions, 1 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c
index 5f421de2d8..9889a9f96c 100644
--- a/apps/gui/gwps-common.c
+++ b/apps/gui/gwps-common.c
@@ -767,8 +767,24 @@ static char *get_token_value(struct gui_wps *gwps,
767 limit = *intval; 767 limit = *intval;
768 *intval = -1; 768 *intval = -1;
769 } 769 }
770 770#if CONFIG_RTC
771 int new_token = token->type;
772 if (token->type == WPS_TOKEN_RTC_HOUR_CFG_ZERO_PADDED)
773 {
774 new_token = global_settings.timeformat == 0?
775 WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED:
776 WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED;
777 }
778 else if (token->type == WPS_TOKEN_RTC_HOUR_CFG)
779 {
780 new_token = global_settings.timeformat == 0?
781 WPS_TOKEN_RTC_HOUR_24:
782 WPS_TOKEN_RTC_HOUR_12;
783 }
784 switch (new_token)
785#else
771 switch (token->type) 786 switch (token->type)
787#endif
772 { 788 {
773 case WPS_TOKEN_CHARACTER: 789 case WPS_TOKEN_CHARACTER:
774 return &(token->value.c); 790 return &(token->value.c);
diff --git a/apps/gui/gwps.h b/apps/gui/gwps.h
index fd435893ac..70a192ad1c 100644
--- a/apps/gui/gwps.h
+++ b/apps/gui/gwps.h
@@ -152,6 +152,8 @@ enum wps_token_type {
152 152
153 WPS_TOKEN_RTC_DAY_OF_MONTH, 153 WPS_TOKEN_RTC_DAY_OF_MONTH,
154 WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED, 154 WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,
155 WPS_TOKEN_RTC_HOUR_CFG_ZERO_PADDED,
156 WPS_TOKEN_RTC_HOUR_CFG,
155 WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, 157 WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED,
156 WPS_TOKEN_RTC_HOUR_24, 158 WPS_TOKEN_RTC_HOUR_24,
157 WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, 159 WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED,
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c
index a0b23734be..2b8975894c 100644
--- a/apps/gui/wps_parser.c
+++ b/apps/gui/wps_parser.c
@@ -166,6 +166,8 @@ static const struct wps_tag all_tags[] = {
166 166
167 { WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_RTC_REFRESH, NULL }, 167 { WPS_TOKEN_RTC_DAY_OF_MONTH, "cd", WPS_RTC_REFRESH, NULL },
168 { WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,"ce", WPS_RTC_REFRESH, NULL }, 168 { WPS_TOKEN_RTC_DAY_OF_MONTH_BLANK_PADDED,"ce", WPS_RTC_REFRESH, NULL },
169 { WPS_TOKEN_RTC_HOUR_CFG_ZERO_PADDED, "cf", WPS_RTC_REFRESH, NULL },
170 { WPS_TOKEN_RTC_HOUR_CFG, "cg", WPS_RTC_REFRESH, NULL },
169 { WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, "cH", WPS_RTC_REFRESH, NULL }, 171 { WPS_TOKEN_RTC_HOUR_24_ZERO_PADDED, "cH", WPS_RTC_REFRESH, NULL },
170 { WPS_TOKEN_RTC_HOUR_24, "ck", WPS_RTC_REFRESH, NULL }, 172 { WPS_TOKEN_RTC_HOUR_24, "ck", WPS_RTC_REFRESH, NULL },
171 { WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, "cI", WPS_RTC_REFRESH, NULL }, 173 { WPS_TOKEN_RTC_HOUR_12_ZERO_PADDED, "cI", WPS_RTC_REFRESH, NULL },