From 11e7ad50a07c0ffcb2005e40c3314bb49a9a1d8b Mon Sep 17 00:00:00 2001 From: Hardeep Sidhu Date: Wed, 2 Jul 2003 15:54:44 +0000 Subject: Added "Ask" option to recursive dir insert which, if enabled, will ask users whether they want to recursively insert selected dir. Also, renamed "Insert first" and "Queue first" to "Insert next" and "Queue next" respectively. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3799 a1c6a512-1295-4272-9138-f99709370657 --- apps/settings.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'apps/settings.c') 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 ) config_block[0x1b] = (unsigned char) (((global_settings.browse_current & 1)) | ((global_settings.play_selected & 1) << 1) | - ((global_settings.recursive_dir_insert & 1) << 2)); + ((global_settings.recursive_dir_insert & 3) << 2)); config_block[0x1c] = (unsigned char)global_settings.peak_meter_hold | (global_settings.rec_editable?0x80:0); @@ -646,7 +646,7 @@ void settings_load(void) global_settings.browse_current = (config_block[0x1b]) & 1; global_settings.play_selected = (config_block[0x1b] >> 1) & 1; global_settings.recursive_dir_insert = - (config_block[0x1b] >> 2) & 1; + (config_block[0x1b] >> 2) & 3; } if (config_block[0x1c] != 0xFF) { @@ -1079,8 +1079,11 @@ bool settings_load_config(char* file) else if (!strcasecmp(name, "max files in playlist")) set_cfg_int(&global_settings.max_files_in_playlist, value, 1000, 20000); - else if (!strcasecmp(name, "recursive directory insert")) - set_cfg_bool(&global_settings.recursive_dir_insert, value); + else if (!strcasecmp(name, "recursive directory insert")) { + static char* options[] = {"off", "on", "ask"}; + set_cfg_option(&global_settings.recursive_dir_insert, value, + options, 3); + } } close(fd); @@ -1369,8 +1372,11 @@ bool settings_save_config(void) fprintf(fd, "max files in playlist: %d\r\n", global_settings.max_files_in_playlist); - fprintf(fd, "recursive directory insert: %s\r\n", - boolopt[global_settings.recursive_dir_insert]); + { + static char* options[] = {"off", "on", "ask"}; + fprintf(fd, "recursive directory insert: %s\r\n", + options[global_settings.recursive_dir_insert]); + } close(fd); @@ -1459,7 +1465,7 @@ void settings_reset(void) { global_settings.max_files_in_dir = 400; global_settings.max_files_in_playlist = 10000; global_settings.show_icons = true; - global_settings.recursive_dir_insert = false; + global_settings.recursive_dir_insert = RECURSE_OFF; } bool set_bool(char* string, bool* variable ) -- cgit v1.2.3