mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -05:00
Move handling of "rockbox_default.[r]wps" into wps.c, out of the skin engine (which should be as generic as possible).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22438 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b944901354
commit
e510de1b35
2 changed files with 29 additions and 24 deletions
|
|
@ -55,9 +55,6 @@
|
||||||
|
|
||||||
#include "backdrop.h"
|
#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
|
#define WPS_ERROR_INVALID_PARAM -1
|
||||||
|
|
||||||
/* level of current conditional.
|
/* level of current conditional.
|
||||||
|
|
@ -1691,27 +1688,6 @@ bool skin_data_load(struct wps_data *wps_data,
|
||||||
}
|
}
|
||||||
else
|
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);
|
int fd = open_utf8(buf, O_RDONLY);
|
||||||
|
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
|
|
|
||||||
|
|
@ -90,12 +90,41 @@ static void track_changed_callback(void *param);
|
||||||
static void nextid3available_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)
|
void wps_data_load(enum screen_type screen, const char *buf, bool isfile)
|
||||||
{
|
{
|
||||||
bool loaded_ok;
|
bool loaded_ok;
|
||||||
|
|
||||||
screens[screen].backdrop_unload(BACKDROP_SKIN_WPS);
|
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,
|
loaded_ok = buf && skin_data_load(gui_wps[screen].data,
|
||||||
&screens[screen], buf, isfile);
|
&screens[screen], buf, isfile);
|
||||||
if (!loaded_ok) /* load the hardcoded default */
|
if (!loaded_ok) /* load the hardcoded default */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue