'Reset settings' now also resets wps, font and language (although you have to reboot to get back to the old language).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2552 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Björn Stenberg 2002-10-09 23:13:25 +00:00
parent d4b884e7e0
commit 227253cfe4
5 changed files with 23 additions and 1 deletions

View file

@ -383,6 +383,9 @@ void settings_apply(void)
global_settings.wps_file);
wps_load(buf, false);
}
else
wps_reset();
#ifdef HAVE_LCD_BITMAP
if ( global_settings.font_file[0] &&
global_settings.font_file[0] != 0xff ) {
@ -390,7 +393,10 @@ void settings_apply(void)
global_settings.font_file);
font_load(buf);
}
else
font_reset();
#endif
if ( global_settings.lang_file[0] &&
global_settings.lang_file[0] != 0xff ) {
snprintf(buf, sizeof buf, ROCKBOX_DIR "/%s.lng",
@ -673,6 +679,9 @@ void settings_reset(void) {
global_settings.peak_meter_release = 8;
global_settings.peak_meter_hold = 1;
global_settings.peak_meter_clip_hold = 16;
global_settings.wps_file[0] = 0;
global_settings.font_file[0] = 0;
global_settings.lang_file[0] = 0;
}

View file

@ -111,6 +111,12 @@ static void wps_format(char* fmt)
}
}
void wps_reset(void)
{
wps_loaded = false;
memset(&format_buffer, 0, sizeof format_buffer);
}
bool wps_load(char* file, bool display)
{
char buffer[FORMAT_BUFFER_SIZE];

View file

@ -25,6 +25,7 @@
bool wps_refresh(struct mp3entry* id3, int ffwd_offset, bool refresh_scroll);
bool wps_display(struct mp3entry* id3);
bool wps_load(char* file, bool display);
void wps_reset(void);
#ifdef HAVE_LCD_CHARCELLS
bool draw_player_progress(struct mp3entry* id3, int ff_rewind_count);

View file

@ -114,6 +114,11 @@ static int readstrpad(char *buf, int totlen)
return totlen;
}
void font_reset(void)
{
memset(&font_ui, 0, sizeof(struct font));
}
/* read and load font into incore font structure*/
struct font* font_load(char *path)
{
@ -132,7 +137,7 @@ struct font* font_load(char *path)
return NULL;
}
memset(pf, 0, sizeof(struct font));
font_reset();
/* currently, font loading replaces earlier font allocation*/
freeptr = (unsigned char *)(((int)mbuf + 3) & ~3);

View file

@ -102,6 +102,7 @@ struct font {
void font_init(void);
struct font* font_load(char *path);
struct font* font_get(int font);
void font_reset(void);
#else /* HAVE_LCD_BITMAP */