summaryrefslogtreecommitdiff
path: root/apps/gui/wps.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-20 14:29:03 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-20 14:29:03 +0000
commite510de1b351de2e5784088bfa9db5573bb921450 (patch)
tree5e835407bfed4ee47d515b792e5628284d2a597d /apps/gui/wps.c
parentb944901354a2e7d7f149e36b872c931c1a2529fe (diff)
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
Diffstat (limited to 'apps/gui/wps.c')
-rw-r--r--apps/gui/wps.c29
1 files changed, 29 insertions, 0 deletions
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 */