summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2009-08-16 20:12:17 +0000
committerThomas Martitz <kugel@rockbox.org>2009-08-16 20:12:17 +0000
commitc4266283f6afeda25b6437044a17816112ab72f1 (patch)
treea9619f0f8c6ac005c5b8f223efc04e278478e170
parent9db05403bd67aa91008bedd492251d897057a9a1 (diff)
downloadrockbox-c4266283f6afeda25b6437044a17816112ab72f1.tar.gz
rockbox-c4266283f6afeda25b6437044a17816112ab72f1.tar.bz2
rockbox-c4266283f6afeda25b6437044a17816112ab72f1.zip
Fix loading of multiple .wps/.rwps files in a row, by reloading all wpses upon loading one so that the skin buffer can be reset properly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22354 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/filetree.c2
-rw-r--r--apps/settings.c64
-rw-r--r--apps/settings.h6
3 files changed, 47 insertions, 25 deletions
diff --git a/apps/filetree.c b/apps/filetree.c
index 6a7da4067e..2d05bd54cf 100644
--- a/apps/filetree.c
+++ b/apps/filetree.c
@@ -487,6 +487,7 @@ int ft_enter(struct tree_context* c)
wps_data_load(SCREEN_MAIN, buf, true);
set_file(buf, (char *)global_settings.wps_file,
MAX_FILENAME);
+ settings_apply_skins();
break;
#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
@@ -499,6 +500,7 @@ int ft_enter(struct tree_context* c)
wps_data_load(SCREEN_REMOTE, buf, true);
set_file(buf, (char *)global_settings.rwps_file,
MAX_FILENAME);
+ settings_apply_skins();
break;
#endif
diff --git a/apps/settings.c b/apps/settings.c
index 72e5a012e4..1b0abfbf46 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -724,6 +724,41 @@ void sound_settings_apply(void)
#endif
}
+
+
+/* call this after loading a .wps/.rwps pr other skin files, so that the
+ * skin buffer is reset properly
+ */
+void settings_apply_skins(void)
+{
+ char buf[MAX_PATH];
+ /* re-initialize the skin buffer before we start reloading skins */
+ skin_buffer_init();
+ if ( global_settings.wps_file[0] &&
+ global_settings.wps_file[0] != 0xff ) {
+ snprintf(buf, sizeof buf, WPS_DIR "/%s.wps",
+ global_settings.wps_file);
+ wps_data_load(SCREEN_MAIN, buf, true);
+ }
+ else
+ {
+ wps_data_init(SCREEN_MAIN);
+ wps_data_load(SCREEN_MAIN, NULL, true);
+ }
+#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
+ if ( global_settings.rwps_file[0]) {
+ snprintf(buf, sizeof buf, WPS_DIR "/%s.rwps",
+ global_settings.rwps_file);
+ wps_data_load(SCREEN_REMOTE, buf, true);
+ }
+ else
+ {
+ wps_data_init(SCREEN_REMOTE);
+ wps_data_load(SCREEN_REMOTE, NULL, true);
+ }
+#endif
+}
+
void settings_apply(bool read_disk)
{
char buf[64];
@@ -819,8 +854,6 @@ void settings_apply(bool read_disk)
if (read_disk)
{
- /* re-initialize the skin buffer before we start reloading skins */
- skin_buffer_init();
#ifdef HAVE_LCD_BITMAP
/* fonts need to be loaded before the WPS */
@@ -842,17 +875,6 @@ void settings_apply(bool read_disk)
load_kbd(NULL);
#endif
- if ( global_settings.wps_file[0] &&
- global_settings.wps_file[0] != 0xff ) {
- snprintf(buf, sizeof buf, WPS_DIR "/%s.wps",
- global_settings.wps_file);
- wps_data_load(SCREEN_MAIN, buf, true);
- }
- else
- {
- wps_data_init(SCREEN_MAIN);
- wps_data_load(SCREEN_MAIN, NULL, true);
- }
#if LCD_DEPTH > 1
if ( global_settings.backdrop_file[0] &&
@@ -868,24 +890,16 @@ void settings_apply(bool read_disk)
FOR_NB_SCREENS(screen)
screens[screen].backdrop_show(BACKDROP_MAIN);
-#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
- if ( global_settings.rwps_file[0]) {
- snprintf(buf, sizeof buf, WPS_DIR "/%s.rwps",
- global_settings.rwps_file);
- wps_data_load(SCREEN_REMOTE, buf, true);
- }
- else
- {
- wps_data_init(SCREEN_REMOTE);
- wps_data_load(SCREEN_REMOTE, NULL, true);
- }
-#endif
if ( global_settings.lang_file[0]) {
snprintf(buf, sizeof buf, LANG_DIR "/%s.lng",
global_settings.lang_file);
lang_load(buf);
talk_init(); /* use voice of same language */
}
+
+ /* reload wpses */
+ settings_apply_skins();
+
/* load the icon set */
icons_init();
diff --git a/apps/settings.h b/apps/settings.h
index 2cf026b083..becf164a8f 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -244,6 +244,12 @@ struct settings_list;
void reset_setting(const struct settings_list *setting, void *var);
void settings_reset(void);
void sound_settings_apply(void);
+
+/* call this after loading a .wps/.rwps pr other skin files, so that the
+ * skin buffer is reset properly
+ */
+void settings_apply_skins(void);
+
void settings_apply(bool read_disk);
void settings_apply_pm_range(void);
void settings_display(void);