diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-08-20 14:29:03 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-08-20 14:29:03 +0000 |
commit | e510de1b351de2e5784088bfa9db5573bb921450 (patch) | |
tree | 5e835407bfed4ee47d515b792e5628284d2a597d | |
parent | b944901354a2e7d7f149e36b872c931c1a2529fe (diff) | |
download | rockbox-e510de1b351de2e5784088bfa9db5573bb921450.tar.gz rockbox-e510de1b351de2e5784088bfa9db5573bb921450.zip |
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
-rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 24 | ||||
-rw-r--r-- | apps/gui/wps.c | 29 |
2 files changed, 29 insertions, 24 deletions
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 @@ | |||
55 | 55 | ||
56 | #include "backdrop.h" | 56 | #include "backdrop.h" |
57 | 57 | ||
58 | #define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" | ||
59 | #define RWPS_DEFAULTCFG WPS_DIR "/rockbox_default.rwps" | ||
60 | |||
61 | #define WPS_ERROR_INVALID_PARAM -1 | 58 | #define WPS_ERROR_INVALID_PARAM -1 |
62 | 59 | ||
63 | /* level of current conditional. | 60 | /* level of current conditional. |
@@ -1691,27 +1688,6 @@ bool skin_data_load(struct wps_data *wps_data, | |||
1691 | } | 1688 | } |
1692 | else | 1689 | else |
1693 | { | 1690 | { |
1694 | /* | ||
1695 | * Hardcode loading WPS_DEFAULTCFG to cause a reset ideally this | ||
1696 | * wants to be a virtual file. Feel free to modify dirbrowse() | ||
1697 | * if you're feeling brave. | ||
1698 | */ | ||
1699 | #ifndef __PCTOOL__ | ||
1700 | if (! strcmp(buf, WPS_DEFAULTCFG) ) | ||
1701 | { | ||
1702 | global_settings.wps_file[0] = 0; | ||
1703 | return false; | ||
1704 | } | ||
1705 | |||
1706 | #ifdef HAVE_REMOTE_LCD | ||
1707 | if (! strcmp(buf, RWPS_DEFAULTCFG) ) | ||
1708 | { | ||
1709 | global_settings.rwps_file[0] = 0; | ||
1710 | return false; | ||
1711 | } | ||
1712 | #endif | ||
1713 | #endif /* __PCTOOL__ */ | ||
1714 | |||
1715 | int fd = open_utf8(buf, O_RDONLY); | 1691 | int fd = open_utf8(buf, O_RDONLY); |
1716 | 1692 | ||
1717 | if (fd < 0) | 1693 | 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); | |||
90 | static void nextid3available_callback(void* param); | 90 | static void nextid3available_callback(void* param); |
91 | 91 | ||
92 | 92 | ||
93 | #define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" | ||
94 | #ifdef HAVE_REMOTE_LCD | ||
95 | #define RWPS_DEFAULTCFG WPS_DIR "/rockbox_default.rwps" | ||
96 | #define DEFAULT_WPS(screen) ((screen) == SCREEN_MAIN ? \ | ||
97 | WPS_DEFAULTCFG:RWPS_DEFAULTCFG) | ||
98 | #else | ||
99 | #define DEFAULT_WPS(screen) (WPS_DEFAULTCFG) | ||
100 | #endif | ||
101 | |||
93 | void wps_data_load(enum screen_type screen, const char *buf, bool isfile) | 102 | void wps_data_load(enum screen_type screen, const char *buf, bool isfile) |
94 | { | 103 | { |
95 | bool loaded_ok; | 104 | bool loaded_ok; |
96 | 105 | ||
97 | screens[screen].backdrop_unload(BACKDROP_SKIN_WPS); | 106 | screens[screen].backdrop_unload(BACKDROP_SKIN_WPS); |
98 | 107 | ||
108 | #ifndef __PCTOOL__ | ||
109 | /* | ||
110 | * Hardcode loading WPS_DEFAULTCFG to cause a reset ideally this | ||
111 | * wants to be a virtual file. Feel free to modify dirbrowse() | ||
112 | * if you're feeling brave. | ||
113 | */ | ||
114 | |||
115 | if (! strcmp(buf, DEFAULT_WPS(screen)) ) | ||
116 | { | ||
117 | #ifdef HAVE_REMOTE_LCD | ||
118 | if (screen == SCREEN_REMOTE) | ||
119 | global_settings.rwps_file[0] = '\0'; | ||
120 | else | ||
121 | #endif | ||
122 | global_settings.wps_file[0] = '\0'; | ||
123 | buf = NULL; | ||
124 | } | ||
125 | |||
126 | #endif /* __PCTOOL__ */ | ||
127 | |||
99 | loaded_ok = buf && skin_data_load(gui_wps[screen].data, | 128 | loaded_ok = buf && skin_data_load(gui_wps[screen].data, |
100 | &screens[screen], buf, isfile); | 129 | &screens[screen], buf, isfile); |
101 | if (!loaded_ok) /* load the hardcoded default */ | 130 | if (!loaded_ok) /* load the hardcoded default */ |