Index: apps/gui/gwps-common.c =================================================================== --- apps/gui/gwps-common.c (revision 18408) +++ apps/gui/gwps-common.c (working copy) @@ -1396,6 +1396,13 @@ else return NULL; #endif + + case WPS_TOKEN_SETTING: + { + cfg_to_string(token->value.i,buf,buf_size); + return buf; + } + default: return NULL; } Index: apps/gui/gwps.h =================================================================== --- apps/gui/gwps.h (revision 18408) +++ apps/gui/gwps.h (working copy) @@ -292,7 +292,10 @@ #endif /* Viewport display */ - WPS_VIEWPORT_ENABLE + WPS_VIEWPORT_ENABLE, + + /* Setting option */ + WPS_TOKEN_SETTING, }; struct wps_token { Index: apps/gui/wps_parser.c =================================================================== --- apps/gui/wps_parser.c (revision 18408) +++ apps/gui/wps_parser.c (working copy) @@ -56,6 +56,7 @@ #include "gwps.h" #include "settings.h" +#include "settings_list.h" #ifdef HAVE_LCD_BITMAP #include "bmp.h" @@ -137,6 +138,8 @@ struct wps_token *token, struct wps_data *wps_data); static int parse_dir_level(const char *wps_bufptr, struct wps_token *token, struct wps_data *wps_data); +static int parse_setting(const char *wps_bufptr, + struct wps_token *token, struct wps_data *wps_data); #ifdef HAVE_LCD_BITMAP static int parse_viewport_display(const char *wps_bufptr, @@ -340,6 +343,8 @@ #endif #endif + { WPS_TOKEN_SETTING, "St", WPS_REFRESH_STATIC, parse_setting }, + { WPS_TOKEN_UNKNOWN, "", 0, NULL } /* the array MUST end with an empty string (first char is \0) */ }; @@ -724,7 +729,38 @@ return skip_end_of_line(wps_bufptr); } +static int parse_setting(const char *wps_bufptr, + struct wps_token *token, + struct wps_data *wps_data) +{ + (void)wps_data; + const char *ptr = wps_bufptr; + const char *end; + int i; + /* Find the setting's cfg_name */ + if (*ptr != '|') + return WPS_ERROR_INVALID_PARAM; + ptr++; + end = strchr(ptr,'|'); + if (!end) + return WPS_ERROR_INVALID_PARAM; + + /* Find the setting */ + for (i=0; ivalue.i = i; + + /* Skip the rest of the line */ + return end-ptr+2; +} + + #if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)) static int parse_image_special(const char *wps_bufptr, struct wps_token *token,