SHARE
TWEET

Untitled

a guest Feb 26th, 2010 175 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Index: apps/settings.c
  2. ===================================================================
  3. --- apps/settings.c     (revision 24916)
  4. +++ apps/settings.c     (working copy)
  5.  -739,61 +739,6 @@
  6.  }
  7.  
  8.  
  9. -
  10. -/* call this after loading a .wps/.rwps or other skin files, so that the
  11. - * skin buffer is reset properly
  12. - */
  13. -struct skin_load_setting {
  14. -    char* setting;
  15. -    char* suffix;
  16. -    void (*loadfunc)(enum screen_type screen, const char *buf, bool isfile);
  17. -};
  18. -static struct skin_load_setting skins[] = {
  19. -    /* This determins the load order. *sbs must be loaded before any other
  20. -     * skin on that screen */
  21. -#ifdef HAVE_LCD_BITMAP
  22. -    { global_settings.sbs_file, "sbs", sb_skin_data_load},
  23. -#endif    
  24. -    { global_settings.wps_file, "wps", wps_data_load},
  25. -#ifdef HAVE_REMOTE_LCD
  26. -    { global_settings.rsbs_file, "rsbs", sb_skin_data_load},
  27. -    { global_settings.rwps_file, "rwps", wps_data_load},
  28. -#endif
  29. -};
  30. -void settings_apply_skins(void)
  31. -{
  32. -    char buf[MAX_PATH];
  33. -    /* re-initialize the skin buffer before we start reloading skins */
  34. -    skin_buffer_init();
  35. -    enum screen_type screen = SCREEN_MAIN;
  36. -    unsigned int i;
  37. -#ifdef HAVE_LCD_BITMAP
  38. -    skin_backdrop_init();
  39. -    skin_font_init();
  40. -#endif
  41. -    for (i=0; i<sizeof(skins)/sizeof(*skins); i++)
  42. -    {
  43. -#ifdef HAVE_REMOTE_LCD
  44. -        screen = skins[i].suffix[0] == 'r' ? SCREEN_REMOTE : SCREEN_MAIN;
  45. -#endif
  46. -        if (skins[i].setting[0] && skins[i].setting[0] != '-')
  47. -        {
  48. -            snprintf(buf, sizeof buf, WPS_DIR "/%s.%s",
  49. -                     skins[i].setting, skins[i].suffix);
  50. -            skins[i].loadfunc(screen, buf, true);
  51. -        }
  52. -        else
  53. -        {
  54. -            skins[i].loadfunc(screen, NULL, true);
  55. -        }
  56. -    }
  57. -    viewportmanager_theme_changed(THEME_STATUSBAR);
  58. -#if LCD_DEPTH > 1 || defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
  59. -    FOR_NB_SCREENS(i)
  60. -        screens[i].backdrop_show(sb_get_backdrop(i));
  61. -#endif
  62. -}
  63. -
  64.  void settings_apply(bool read_disk)
  65.  {
  66.      
  67.  -924,9 +869,6 @@
  68.              talk_init(); /* use voice of same language */
  69.          }
  70.  
  71. -        /* reload wpses */
  72. -        settings_apply_skins();
  73. -
  74.          /* load the icon set */
  75.          icons_init();
  76.  
  77. Index: apps/gui/theme_settings.c
  78. ===================================================================
  79. --- apps/gui/theme_settings.c   (revision 0)
  80. +++ apps/gui/theme_settings.c   (revision 0)
  81.  -0,0 +1,91 @@
  82. +/***************************************************************************
  83. + *             __________               __   ___.
  84. + *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
  85. + *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
  86. + *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
  87. + *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
  88. + *                     \/            \/     \/    \/            \/
  89. + * $Id: settings.c 24848 2010-02-22 07:25:13Z jdgordon $
  90. + *
  91. + * Copyright (C) 2002 by Stuart Martin
  92. + * RTC config saving code (C) 2002 by hessu@hes.iki.fi
  93. + *
  94. + * This program is free software; you can redistribute it and/or
  95. + * modify it under the terms of the GNU General Public License
  96. + * as published by the Free Software Foundation; either version 2
  97. + * of the License, or (at your option) any later version.
  98. + *
  99. + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  100. + * KIND, either express or implied.
  101. + *
  102. + ****************************************************************************/
  103. +#include <stdio.h>
  104. +#include <stddef.h>
  105. +#include <stdlib.h>
  106. +#include <limits.h>
  107. +#include "inttypes.h"
  108. +#include "config.h"
  109. +#include "action.h"
  110. +#include "crc32.h"
  111. +#include "settings.h"
  112. +#include "wps.h"
  113. +#include "file.h"
  114. +#include "skin_engine/skin_engine.h"
  115. +#include "statusbar-skinned.h"
  116. +
  117. +
  118. +
  119. +/* call this after loading a .wps/.rwps or other skin files, so that the
  120. + * skin buffer is reset properly
  121. + */
  122. +struct skin_load_setting {
  123. +    char* setting;
  124. +    char* suffix;
  125. +    void (*loadfunc)(enum screen_type screen, const char *buf, bool isfile);
  126. +};
  127. +static struct skin_load_setting skins[] = {
  128. +    /* This determins the load order. *sbs must be loaded before any other
  129. +     * skin on that screen */
  130. +#ifdef HAVE_LCD_BITMAP
  131. +    { global_settings.sbs_file, "sbs", sb_skin_data_load},
  132. +#endif    
  133. +    { global_settings.wps_file, "wps", wps_data_load},
  134. +#ifdef HAVE_REMOTE_LCD
  135. +    { global_settings.rsbs_file, "rsbs", sb_skin_data_load},
  136. +    { global_settings.rwps_file, "rwps", wps_data_load},
  137. +#endif
  138. +};
  139. +
  140. +void settings_apply_skins(void)
  141. +{
  142. +    char buf[MAX_PATH];
  143. +    /* re-initialize the skin buffer before we start reloading skins */
  144. +    skin_buffer_init();
  145. +    enum screen_type screen = SCREEN_MAIN;
  146. +    unsigned int i;
  147. +#ifdef HAVE_LCD_BITMAP
  148. +    skin_backdrop_init();
  149. +    skin_font_init();
  150. +#endif
  151. +    for (i=0; i<sizeof(skins)/sizeof(*skins); i++)
  152. +    {
  153. +#ifdef HAVE_REMOTE_LCD
  154. +        screen = skins[i].suffix[0] == 'r' ? SCREEN_REMOTE : SCREEN_MAIN;
  155. +#endif
  156. +        if (skins[i].setting[0] && skins[i].setting[0] != '-')
  157. +        {
  158. +            snprintf(buf, sizeof buf, WPS_DIR "/%s.%s",
  159. +                     skins[i].setting, skins[i].suffix);
  160. +            skins[i].loadfunc(screen, buf, true);
  161. +        }
  162. +        else
  163. +        {
  164. +            skins[i].loadfunc(screen, NULL, true);
  165. +        }
  166. +    }
  167. +    viewportmanager_theme_changed(THEME_STATUSBAR);
  168. +#if LCD_DEPTH > 1 || defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
  169. +    FOR_NB_SCREENS(i)
  170. +        screens[i].backdrop_show(sb_get_backdrop(i));
  171. +#endif
  172. +}
  173. Index: apps/SOURCES
  174. ===================================================================
  175. --- apps/SOURCES        (revision 24916)
  176. +++ apps/SOURCES        (working copy)
  177.  -84,6 +84,7 @@
  178.  #ifdef HAVE_LCD_BITMAP
  179.  gui/statusbar-skinned.c
  180.  #endif
  181. +gui/theme_settings.c
  182.  gui/yesno.c
  183.  gui/viewport.c
  184.  
  185. Index: apps/main.c
  186. ===================================================================
  187. --- apps/main.c (revision 24916)
  188. +++ apps/main.c (working copy)
  189.  -329,7 +329,7 @@
  190.      storage_init();
  191.      settings_reset();
  192.      settings_load(SETTINGS_ALL);
  193. -    settings_apply(false);
  194. +    settings_apply(true);
  195.      init_dircache(true);
  196.      init_dircache(false);
  197.  #ifdef HAVE_TAGCACHE
  198.  -368,7 +368,7 @@
  199.      audio_init();
  200.      button_clear_queue(); /* Empty the keyboard buffer */
  201.      
  202. -    settings_apply(true);
  203. +    settings_apply_skins();
  204.  }
  205.  
  206.  #else
  207.  -562,7 +562,7 @@
  208.  #endif
  209.      }
  210.  
  211. -    settings_apply(false);
  212. +    settings_apply(true);
  213.      init_dircache(false);
  214.  #ifdef HAVE_TAGCACHE
  215.      init_tagcache();
  216.  -628,7 +628,7 @@
  217.      check_bootfile(false); /* remember write time and filesize */
  218.  #endif
  219.  
  220. -    settings_apply(true);
  221. +    settings_apply_skins();
  222.  }
  223.  
  224.  #ifdef CPU_PP
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top