diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index 892bb3d933..639c81ed17 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -55,9 +55,6 @@ #include "backdrop.h" -#define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" -#define RWPS_DEFAULTCFG WPS_DIR "/rockbox_default.rwps" - #define WPS_ERROR_INVALID_PARAM -1 /* level of current conditional. @@ -1691,27 +1688,6 @@ bool skin_data_load(struct wps_data *wps_data, } else { - /* - * Hardcode loading WPS_DEFAULTCFG to cause a reset ideally this - * wants to be a virtual file. Feel free to modify dirbrowse() - * if you're feeling brave. - */ -#ifndef __PCTOOL__ - if (! strcmp(buf, WPS_DEFAULTCFG) ) - { - global_settings.wps_file[0] = 0; - return false; - } - -#ifdef HAVE_REMOTE_LCD - if (! strcmp(buf, RWPS_DEFAULTCFG) ) - { - global_settings.rwps_file[0] = 0; - return false; - } -#endif -#endif /* __PCTOOL__ */ - int fd = open_utf8(buf, O_RDONLY); if (fd < 0) diff --git a/apps/gui/wps.c b/apps/gui/wps.c index 79f35c61eb..ed3bf5f6b3 100644 --- a/apps/gui/wps.c +++ b/apps/gui/wps.c @@ -90,12 +90,41 @@ static void track_changed_callback(void *param); static void nextid3available_callback(void* param); +#define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" +#ifdef HAVE_REMOTE_LCD +#define RWPS_DEFAULTCFG WPS_DIR "/rockbox_default.rwps" +#define DEFAULT_WPS(screen) ((screen) == SCREEN_MAIN ? \ + WPS_DEFAULTCFG:RWPS_DEFAULTCFG) +#else +#define DEFAULT_WPS(screen) (WPS_DEFAULTCFG) +#endif + void wps_data_load(enum screen_type screen, const char *buf, bool isfile) { bool loaded_ok; screens[screen].backdrop_unload(BACKDROP_SKIN_WPS); +#ifndef __PCTOOL__ + /* + * Hardcode loading WPS_DEFAULTCFG to cause a reset ideally this + * wants to be a virtual file. Feel free to modify dirbrowse() + * if you're feeling brave. + */ + + if (! strcmp(buf, DEFAULT_WPS(screen)) ) + { +#ifdef HAVE_REMOTE_LCD + if (screen == SCREEN_REMOTE) + global_settings.rwps_file[0] = '\0'; + else +#endif + global_settings.wps_file[0] = '\0'; + buf = NULL; + } + +#endif /* __PCTOOL__ */ + loaded_ok = buf && skin_data_load(gui_wps[screen].data, &screens[screen], buf, isfile); if (!loaded_ok) /* load the hardcoded default */