diff options
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 35 | ||||
-rw-r--r-- | apps/gui/skin_engine/wps_internals.h | 3 |
2 files changed, 27 insertions, 11 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index be25bd0125..867f2b6a18 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c | |||
@@ -44,6 +44,8 @@ | |||
44 | #else | 44 | #else |
45 | #include "action.h" | 45 | #include "action.h" |
46 | #include "checkwps.h" | 46 | #include "checkwps.h" |
47 | #include "language.h" | ||
48 | #include "lang_enum.h" | ||
47 | #include "audio.h" | 49 | #include "audio.h" |
48 | #define lang_is_rtl() (false) | 50 | #define lang_is_rtl() (false) |
49 | #define DEBUGF printf | 51 | #define DEBUGF printf |
@@ -804,22 +806,29 @@ static int parse_setting_and_lang(struct skin_element *element, | |||
804 | struct wps_token *token, | 806 | struct wps_token *token, |
805 | struct wps_data *wps_data) | 807 | struct wps_data *wps_data) |
806 | { | 808 | { |
807 | /* NOTE: both the string validations that happen in here will | ||
808 | * automatically PASS on checkwps because its too hard to get | ||
809 | * settings_list.c and english.lang built for it. | ||
810 | * If that ever changes remove the #ifndef __PCTOOL__'s here | ||
811 | */ | ||
812 | (void)wps_data; | 809 | (void)wps_data; |
813 | char *temp = get_param_text(element, 0); | 810 | char *temp = get_param_text(element, 0); |
814 | 811 | ||
815 | if (token->type == SKIN_TOKEN_TRANSLATEDSTRING) | 812 | if (token->type == SKIN_TOKEN_TRANSLATEDSTRING) |
816 | { | 813 | { |
817 | #ifndef __PCTOOL__ | ||
818 | int i = lang_english_to_id(temp); | 814 | int i = lang_english_to_id(temp); |
819 | if (i < 0) | 815 | if (i < 0) { |
816 | DEBUGF("Translated String [%s] NOT FOUND\n", temp); | ||
817 | /* Due to conditionals in a theme, a missing string | ||
818 | might never be hit. So currently we have to just treat | ||
819 | this as an advisory */ | ||
820 | #if 1 | ||
820 | i = LANG_LAST_INDEX_IN_ARRAY; | 821 | i = LANG_LAST_INDEX_IN_ARRAY; |
821 | token->value.i = i; | 822 | #else |
823 | return WPS_ERROR_INVALID_PARAM; | ||
824 | #endif | ||
825 | } | ||
826 | #ifdef DEBUG_SKIN_ENGINE | ||
827 | else if (debug_wps) { | ||
828 | DEBUGF("Translated String [%s] = %d\n", temp, i); | ||
829 | } | ||
822 | #endif | 830 | #endif |
831 | token->value.i = i; | ||
823 | } | 832 | } |
824 | else if (element->params_count > 1) | 833 | else if (element->params_count > 1) |
825 | { | 834 | { |
@@ -830,11 +839,17 @@ static int parse_setting_and_lang(struct skin_element *element, | |||
830 | } | 839 | } |
831 | else | 840 | else |
832 | { | 841 | { |
842 | /* NOTE: The string validations that happen here will | ||
843 | * automatically PASS on checkwps because its too hard to get | ||
844 | * settings_list.c built for a specific target. | ||
845 | * If that ever changes remove the #ifndef __PCTOOL__ here | ||
846 | */ | ||
833 | #ifndef __PCTOOL__ | 847 | #ifndef __PCTOOL__ |
834 | const struct settings_list *setting = find_setting_by_cfgname(temp); | 848 | const struct settings_list *setting = find_setting_by_cfgname(temp); |
835 | if (!setting) | 849 | if (!setting) { |
850 | DEBUGF("Invalid setting [%s]\n", temp); | ||
836 | return WPS_ERROR_INVALID_PARAM; | 851 | return WPS_ERROR_INVALID_PARAM; |
837 | 852 | } | |
838 | token->value.xdata = (void *)setting; | 853 | token->value.xdata = (void *)setting; |
839 | #endif | 854 | #endif |
840 | } | 855 | } |
diff --git a/apps/gui/skin_engine/wps_internals.h b/apps/gui/skin_engine/wps_internals.h index 6e20ed8da9..c4e319fca5 100644 --- a/apps/gui/skin_engine/wps_internals.h +++ b/apps/gui/skin_engine/wps_internals.h | |||
@@ -442,7 +442,8 @@ enum skin_find_what { | |||
442 | }; | 442 | }; |
443 | void *skin_find_item(const char *label, enum skin_find_what what, | 443 | void *skin_find_item(const char *label, enum skin_find_what what, |
444 | struct wps_data *data); | 444 | struct wps_data *data); |
445 | #ifdef SIMULATOR | 445 | |
446 | #if defined(SIMULATOR) || defined(CHECKWPS) | ||
446 | #define DEBUG_SKIN_ENGINE | 447 | #define DEBUG_SKIN_ENGINE |
447 | extern bool debug_wps; | 448 | extern bool debug_wps; |
448 | #endif | 449 | #endif |