summaryrefslogtreecommitdiff
path: root/apps/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/settings.c')
-rw-r--r--apps/settings.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/apps/settings.c b/apps/settings.c
index e5fbfb5e06..90775edab3 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -351,7 +351,7 @@ int settings_save( void )
351 config_block[0x1b] = (unsigned char) 351 config_block[0x1b] = (unsigned char)
352 (((global_settings.browse_current & 1)) | 352 (((global_settings.browse_current & 1)) |
353 ((global_settings.play_selected & 1) << 1) | 353 ((global_settings.play_selected & 1) << 1) |
354 ((global_settings.recursive_dir_insert & 1) << 2)); 354 ((global_settings.recursive_dir_insert & 3) << 2));
355 355
356 config_block[0x1c] = (unsigned char)global_settings.peak_meter_hold | 356 config_block[0x1c] = (unsigned char)global_settings.peak_meter_hold |
357 (global_settings.rec_editable?0x80:0); 357 (global_settings.rec_editable?0x80:0);
@@ -646,7 +646,7 @@ void settings_load(void)
646 global_settings.browse_current = (config_block[0x1b]) & 1; 646 global_settings.browse_current = (config_block[0x1b]) & 1;
647 global_settings.play_selected = (config_block[0x1b] >> 1) & 1; 647 global_settings.play_selected = (config_block[0x1b] >> 1) & 1;
648 global_settings.recursive_dir_insert = 648 global_settings.recursive_dir_insert =
649 (config_block[0x1b] >> 2) & 1; 649 (config_block[0x1b] >> 2) & 3;
650 } 650 }
651 651
652 if (config_block[0x1c] != 0xFF) { 652 if (config_block[0x1c] != 0xFF) {
@@ -1079,8 +1079,11 @@ bool settings_load_config(char* file)
1079 else if (!strcasecmp(name, "max files in playlist")) 1079 else if (!strcasecmp(name, "max files in playlist"))
1080 set_cfg_int(&global_settings.max_files_in_playlist, value, 1080 set_cfg_int(&global_settings.max_files_in_playlist, value,
1081 1000, 20000); 1081 1000, 20000);
1082 else if (!strcasecmp(name, "recursive directory insert")) 1082 else if (!strcasecmp(name, "recursive directory insert")) {
1083 set_cfg_bool(&global_settings.recursive_dir_insert, value); 1083 static char* options[] = {"off", "on", "ask"};
1084 set_cfg_option(&global_settings.recursive_dir_insert, value,
1085 options, 3);
1086 }
1084 } 1087 }
1085 1088
1086 close(fd); 1089 close(fd);
@@ -1369,8 +1372,11 @@ bool settings_save_config(void)
1369 fprintf(fd, "max files in playlist: %d\r\n", 1372 fprintf(fd, "max files in playlist: %d\r\n",
1370 global_settings.max_files_in_playlist); 1373 global_settings.max_files_in_playlist);
1371 1374
1372 fprintf(fd, "recursive directory insert: %s\r\n", 1375 {
1373 boolopt[global_settings.recursive_dir_insert]); 1376 static char* options[] = {"off", "on", "ask"};
1377 fprintf(fd, "recursive directory insert: %s\r\n",
1378 options[global_settings.recursive_dir_insert]);
1379 }
1374 1380
1375 close(fd); 1381 close(fd);
1376 1382
@@ -1459,7 +1465,7 @@ void settings_reset(void) {
1459 global_settings.max_files_in_dir = 400; 1465 global_settings.max_files_in_dir = 400;
1460 global_settings.max_files_in_playlist = 10000; 1466 global_settings.max_files_in_playlist = 10000;
1461 global_settings.show_icons = true; 1467 global_settings.show_icons = true;
1462 global_settings.recursive_dir_insert = false; 1468 global_settings.recursive_dir_insert = RECURSE_OFF;
1463} 1469}
1464 1470
1465bool set_bool(char* string, bool* variable ) 1471bool set_bool(char* string, bool* variable )