summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-02-21 20:34:27 +0000
committerThomas Martitz <kugel@rockbox.org>2010-02-21 20:34:27 +0000
commitec0ca10ddf58604d8ce2a5f73cedabbaa8965a75 (patch)
treeaf46ec42a418275ae162c349766c77db891fdbe8 /apps
parent3d6faa08bf95da6e0f65a070a11f014e78c0b682 (diff)
downloadrockbox-ec0ca10ddf58604d8ce2a5f73cedabbaa8965a75.tar.gz
rockbox-ec0ca10ddf58604d8ce2a5f73cedabbaa8965a75.zip
Properly generate (with "Save Theme Settings") and handle filename settings with "-".
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24816 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/menus/theme_menu.c3
-rw-r--r--apps/settings.c16
-rw-r--r--apps/settings_list.c14
3 files changed, 21 insertions, 12 deletions
diff --git a/apps/menus/theme_menu.c b/apps/menus/theme_menu.c
index 7c19335df9..038f9079d9 100644
--- a/apps/menus/theme_menu.c
+++ b/apps/menus/theme_menu.c
@@ -47,7 +47,8 @@
47 */ 47 */
48static int clear_main_backdrop(void) 48static int clear_main_backdrop(void)
49{ 49{
50 global_settings.backdrop_file[0]=0; 50 global_settings.backdrop_file[0] = '-';
51 global_settings.backdrop_file[1] = '\0';
51 sb_set_backdrop(SCREEN_MAIN, NULL); 52 sb_set_backdrop(SCREEN_MAIN, NULL);
52 viewportmanager_theme_enable(SCREEN_MAIN, false, NULL); 53 viewportmanager_theme_enable(SCREEN_MAIN, false, NULL);
53 viewportmanager_theme_undo(SCREEN_MAIN, true); 54 viewportmanager_theme_undo(SCREEN_MAIN, true);
diff --git a/apps/settings.c b/apps/settings.c
index 536e5e90ee..0bd073e66d 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -465,10 +465,18 @@ bool cfg_to_string(int i/*setting_id*/, char* buf, int buf_len)
465 if (((char*)settings[i].setting)[0] 465 if (((char*)settings[i].setting)[0]
466 && settings[i].filename_setting->prefix) 466 && settings[i].filename_setting->prefix)
467 { 467 {
468 snprintf(buf,buf_len,"%s%s%s", 468 if (((char*)settings[i].setting)[0] == '-')
469 settings[i].filename_setting->prefix, 469 {
470 (char*)settings[i].setting, 470 buf[0] = '-';
471 settings[i].filename_setting->suffix); 471 buf[1] = '\0';
472 }
473 else
474 {
475 snprintf(buf,buf_len,"%s%s%s",
476 settings[i].filename_setting->prefix,
477 (char*)settings[i].setting,
478 settings[i].filename_setting->suffix);
479 }
472 } 480 }
473 else strlcpy(buf,(char*)settings[i].setting, 481 else strlcpy(buf,(char*)settings[i].setting,
474 settings[i].filename_setting->max_len); 482 settings[i].filename_setting->max_len);
diff --git a/apps/settings_list.c b/apps/settings_list.c
index d2700b39c4..c9a4fe36c4 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -199,7 +199,7 @@ static const char graphic_numeric[] = "graphic,numeric";
199 199
200/* Default theme settings */ 200/* Default theme settings */
201#define DEFAULT_WPSNAME "cabbiev2" 201#define DEFAULT_WPSNAME "cabbiev2"
202#define DEFAULT_SBS_NAME DEFAULT_WPSNAME 202#define DEFAULT_SBS_NAME "-"
203 203
204#ifdef HAVE_LCD_BITMAP 204#ifdef HAVE_LCD_BITMAP
205 205
@@ -1425,7 +1425,7 @@ const struct settings_list settings[] = {
1425 OFFON_SETTING(F_BANFROMQS, audioscrobbler, LANG_AUDIOSCROBBLER, false, 1425 OFFON_SETTING(F_BANFROMQS, audioscrobbler, LANG_AUDIOSCROBBLER, false,
1426 "Last.fm Logging", NULL), 1426 "Last.fm Logging", NULL),
1427#if CONFIG_TUNER 1427#if CONFIG_TUNER
1428 TEXT_SETTING(0, fmr_file, "fmr", "", 1428 TEXT_SETTING(0, fmr_file, "fmr", "-",
1429 FMPRESET_PATH "/", ".fmr"), 1429 FMPRESET_PATH "/", ".fmr"),
1430#endif 1430#endif
1431#ifdef HAVE_LCD_BITMAP 1431#ifdef HAVE_LCD_BITMAP
@@ -1434,7 +1434,7 @@ const struct settings_list settings[] = {
1434#endif 1434#endif
1435#ifdef HAVE_REMOTE_LCD 1435#ifdef HAVE_REMOTE_LCD
1436 TEXT_SETTING(F_THEMESETTING, remote_font_file, "remote font", 1436 TEXT_SETTING(F_THEMESETTING, remote_font_file, "remote font",
1437 "", FONT_DIR "/", ".fnt"), 1437 "-", FONT_DIR "/", ".fnt"),
1438#endif 1438#endif
1439 TEXT_SETTING(F_THEMESETTING,wps_file, "wps", 1439 TEXT_SETTING(F_THEMESETTING,wps_file, "wps",
1440 DEFAULT_WPSNAME, WPS_DIR "/", ".wps"), 1440 DEFAULT_WPSNAME, WPS_DIR "/", ".wps"),
@@ -1448,13 +1448,13 @@ const struct settings_list settings[] = {
1448 TEXT_SETTING(F_THEMESETTING,rsbs_file, "rsbs", 1448 TEXT_SETTING(F_THEMESETTING,rsbs_file, "rsbs",
1449 DEFAULT_WPSNAME, SBS_DIR "/", ".rsbs"), 1449 DEFAULT_WPSNAME, SBS_DIR "/", ".rsbs"),
1450#endif 1450#endif
1451 TEXT_SETTING(0,lang_file,"lang","",LANG_DIR "/",".lng"), 1451 TEXT_SETTING(0,lang_file,"lang","-",LANG_DIR "/",".lng"),
1452#if LCD_DEPTH > 1 1452#if LCD_DEPTH > 1
1453 TEXT_SETTING(F_THEMESETTING,backdrop_file,"backdrop", 1453 TEXT_SETTING(F_THEMESETTING,backdrop_file,"backdrop",
1454 DEFAULT_BACKDROP, BACKDROP_DIR "/", ".bmp"), 1454 DEFAULT_BACKDROP, BACKDROP_DIR "/", ".bmp"),
1455#endif 1455#endif
1456#ifdef HAVE_LCD_BITMAP 1456#ifdef HAVE_LCD_BITMAP
1457 TEXT_SETTING(0,kbd_file,"kbd","",ROCKBOX_DIR "/",".kbd"), 1457 TEXT_SETTING(0,kbd_file,"kbd","-",ROCKBOX_DIR "/",".kbd"),
1458#endif 1458#endif
1459#ifdef HAVE_USB_CHARGING_ENABLE 1459#ifdef HAVE_USB_CHARGING_ENABLE
1460 OFFON_SETTING(0,usb_charging,LANG_USB_CHARGING,false,"usb charging",NULL), 1460 OFFON_SETTING(0,usb_charging,LANG_USB_CHARGING,false,"usb charging",NULL),
@@ -1527,10 +1527,10 @@ const struct settings_list settings[] = {
1527 ICON_DIR "/", ".bmp"), 1527 ICON_DIR "/", ".bmp"),
1528#endif 1528#endif
1529#ifdef HAVE_REMOTE_LCD 1529#ifdef HAVE_REMOTE_LCD
1530 TEXT_SETTING(F_THEMESETTING, remote_icon_file, "remote iconset", "", 1530 TEXT_SETTING(F_THEMESETTING, remote_icon_file, "remote iconset", "-",
1531 ICON_DIR "/", ".bmp"), 1531 ICON_DIR "/", ".bmp"),
1532 TEXT_SETTING(F_THEMESETTING, remote_viewers_icon_file, 1532 TEXT_SETTING(F_THEMESETTING, remote_viewers_icon_file,
1533 "remote viewers iconset", "", 1533 "remote viewers iconset", "-",
1534 ICON_DIR "/", ".bmp"), 1534 ICON_DIR "/", ".bmp"),
1535#endif /* HAVE_REMOTE_LCD */ 1535#endif /* HAVE_REMOTE_LCD */
1536#ifdef HAVE_LCD_COLOR 1536#ifdef HAVE_LCD_COLOR