Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: apps/settings.c
- ===================================================================
- --- apps/settings.c (revision 24916)
- +++ apps/settings.c (working copy)
- -739,61 +739,6 @@
- }
- -
- -/* call this after loading a .wps/.rwps or other skin files, so that the
- - * skin buffer is reset properly
- - */
- -struct skin_load_setting {
- - char* setting;
- - char* suffix;
- - void (*loadfunc)(enum screen_type screen, const char *buf, bool isfile);
- -};
- -static struct skin_load_setting skins[] = {
- - /* This determins the load order. *sbs must be loaded before any other
- - * skin on that screen */
- -#ifdef HAVE_LCD_BITMAP
- - { global_settings.sbs_file, "sbs", sb_skin_data_load},
- -#endif
- - { global_settings.wps_file, "wps", wps_data_load},
- -#ifdef HAVE_REMOTE_LCD
- - { global_settings.rsbs_file, "rsbs", sb_skin_data_load},
- - { global_settings.rwps_file, "rwps", wps_data_load},
- -#endif
- -};
- -void settings_apply_skins(void)
- -{
- - char buf[MAX_PATH];
- - /* re-initialize the skin buffer before we start reloading skins */
- - skin_buffer_init();
- - enum screen_type screen = SCREEN_MAIN;
- - unsigned int i;
- -#ifdef HAVE_LCD_BITMAP
- - skin_backdrop_init();
- - skin_font_init();
- -#endif
- - for (i=0; i<sizeof(skins)/sizeof(*skins); i++)
- - {
- -#ifdef HAVE_REMOTE_LCD
- - screen = skins[i].suffix[0] == 'r' ? SCREEN_REMOTE : SCREEN_MAIN;
- -#endif
- - if (skins[i].setting[0] && skins[i].setting[0] != '-')
- - {
- - snprintf(buf, sizeof buf, WPS_DIR "/%s.%s",
- - skins[i].setting, skins[i].suffix);
- - skins[i].loadfunc(screen, buf, true);
- - }
- - else
- - {
- - skins[i].loadfunc(screen, NULL, true);
- - }
- - }
- - viewportmanager_theme_changed(THEME_STATUSBAR);
- -#if LCD_DEPTH > 1 || defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
- - FOR_NB_SCREENS(i)
- - screens[i].backdrop_show(sb_get_backdrop(i));
- -#endif
- -}
- -
- void settings_apply(bool read_disk)
- {
- -924,9 +869,6 @@
- talk_init(); /* use voice of same language */
- }
- - /* reload wpses */
- - settings_apply_skins();
- -
- /* load the icon set */
- icons_init();
- Index: apps/gui/theme_settings.c
- ===================================================================
- --- apps/gui/theme_settings.c (revision 0)
- +++ apps/gui/theme_settings.c (revision 0)
- -0,0 +1,91 @@
- +/***************************************************************************
- + * __________ __ ___.
- + * Open \______ \ ____ ____ | | _\_ |__ _______ ___
- + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
- + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
- + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
- + * \/ \/ \/ \/ \/
- + * $Id: settings.c 24848 2010-02-22 07:25:13Z jdgordon $
- + *
- + * Copyright (C) 2002 by Stuart Martin
- + * RTC config saving code (C) 2002 by hessu@hes.iki.fi
- + *
- + * This program is free software; you can redistribute it and/or
- + * modify it under the terms of the GNU General Public License
- + * as published by the Free Software Foundation; either version 2
- + * of the License, or (at your option) any later version.
- + *
- + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
- + * KIND, either express or implied.
- + *
- + ****************************************************************************/
- +#include <stdio.h>
- +#include <stddef.h>
- +#include <stdlib.h>
- +#include <limits.h>
- +#include "inttypes.h"
- +#include "config.h"
- +#include "action.h"
- +#include "crc32.h"
- +#include "settings.h"
- +#include "wps.h"
- +#include "file.h"
- +#include "skin_engine/skin_engine.h"
- +#include "statusbar-skinned.h"
- +
- +
- +
- +/* call this after loading a .wps/.rwps or other skin files, so that the
- + * skin buffer is reset properly
- + */
- +struct skin_load_setting {
- + char* setting;
- + char* suffix;
- + void (*loadfunc)(enum screen_type screen, const char *buf, bool isfile);
- +};
- +static struct skin_load_setting skins[] = {
- + /* This determins the load order. *sbs must be loaded before any other
- + * skin on that screen */
- +#ifdef HAVE_LCD_BITMAP
- + { global_settings.sbs_file, "sbs", sb_skin_data_load},
- +#endif
- + { global_settings.wps_file, "wps", wps_data_load},
- +#ifdef HAVE_REMOTE_LCD
- + { global_settings.rsbs_file, "rsbs", sb_skin_data_load},
- + { global_settings.rwps_file, "rwps", wps_data_load},
- +#endif
- +};
- +
- +void settings_apply_skins(void)
- +{
- + char buf[MAX_PATH];
- + /* re-initialize the skin buffer before we start reloading skins */
- + skin_buffer_init();
- + enum screen_type screen = SCREEN_MAIN;
- + unsigned int i;
- +#ifdef HAVE_LCD_BITMAP
- + skin_backdrop_init();
- + skin_font_init();
- +#endif
- + for (i=0; i<sizeof(skins)/sizeof(*skins); i++)
- + {
- +#ifdef HAVE_REMOTE_LCD
- + screen = skins[i].suffix[0] == 'r' ? SCREEN_REMOTE : SCREEN_MAIN;
- +#endif
- + if (skins[i].setting[0] && skins[i].setting[0] != '-')
- + {
- + snprintf(buf, sizeof buf, WPS_DIR "/%s.%s",
- + skins[i].setting, skins[i].suffix);
- + skins[i].loadfunc(screen, buf, true);
- + }
- + else
- + {
- + skins[i].loadfunc(screen, NULL, true);
- + }
- + }
- + viewportmanager_theme_changed(THEME_STATUSBAR);
- +#if LCD_DEPTH > 1 || defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
- + FOR_NB_SCREENS(i)
- + screens[i].backdrop_show(sb_get_backdrop(i));
- +#endif
- +}
- Index: apps/SOURCES
- ===================================================================
- --- apps/SOURCES (revision 24916)
- +++ apps/SOURCES (working copy)
- -84,6 +84,7 @@
- #ifdef HAVE_LCD_BITMAP
- gui/statusbar-skinned.c
- #endif
- +gui/theme_settings.c
- gui/yesno.c
- gui/viewport.c
- Index: apps/main.c
- ===================================================================
- --- apps/main.c (revision 24916)
- +++ apps/main.c (working copy)
- -329,7 +329,7 @@
- storage_init();
- settings_reset();
- settings_load(SETTINGS_ALL);
- - settings_apply(false);
- + settings_apply(true);
- init_dircache(true);
- init_dircache(false);
- #ifdef HAVE_TAGCACHE
- -368,7 +368,7 @@
- audio_init();
- button_clear_queue(); /* Empty the keyboard buffer */
- - settings_apply(true);
- + settings_apply_skins();
- }
- #else
- -562,7 +562,7 @@
- #endif
- }
- - settings_apply(false);
- + settings_apply(true);
- init_dircache(false);
- #ifdef HAVE_TAGCACHE
- init_tagcache();
- -628,7 +628,7 @@
- check_bootfile(false); /* remember write time and filesize */
- #endif
- - settings_apply(true);
- + settings_apply_skins();
- }
- #ifdef CPU_PP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement