Provide a context sensitive default file name when saving settings (FS#10399)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21589 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
a85f3695ef
commit
7398c2d20d
1 changed files with 10 additions and 2 deletions
|
@ -620,27 +620,35 @@ int settings_save(void)
|
||||||
bool settings_save_config(int options)
|
bool settings_save_config(int options)
|
||||||
{
|
{
|
||||||
char filename[MAX_PATH];
|
char filename[MAX_PATH];
|
||||||
char *folder;
|
char *folder, *namebase;
|
||||||
switch (options)
|
switch (options)
|
||||||
{
|
{
|
||||||
case SETTINGS_SAVE_THEME:
|
case SETTINGS_SAVE_THEME:
|
||||||
folder = THEME_DIR;
|
folder = THEME_DIR;
|
||||||
|
namebase = "theme";
|
||||||
break;
|
break;
|
||||||
#ifdef HAVE_RECORDING
|
#ifdef HAVE_RECORDING
|
||||||
case SETTINGS_SAVE_RECPRESETS:
|
case SETTINGS_SAVE_RECPRESETS:
|
||||||
folder = RECPRESETS_DIR;
|
folder = RECPRESETS_DIR;
|
||||||
|
namebase = "recording";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_CODEC == SWCODEC
|
#if CONFIG_CODEC == SWCODEC
|
||||||
case SETTINGS_SAVE_EQPRESET:
|
case SETTINGS_SAVE_EQPRESET:
|
||||||
folder = EQS_DIR;
|
folder = EQS_DIR;
|
||||||
|
namebase = "eq";
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
case SETTINGS_SAVE_SOUND:
|
case SETTINGS_SAVE_SOUND:
|
||||||
|
folder = ROCKBOX_DIR;
|
||||||
|
namebase = "sound";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
folder = ROCKBOX_DIR;
|
folder = ROCKBOX_DIR;
|
||||||
|
namebase = "config";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
create_numbered_filename(filename, folder, "config", ".cfg", 2
|
create_numbered_filename(filename, folder, namebase, ".cfg", 2
|
||||||
IF_CNFN_NUM_(, NULL));
|
IF_CNFN_NUM_(, NULL));
|
||||||
|
|
||||||
/* allow user to modify filename */
|
/* allow user to modify filename */
|
||||||
|
|
Loading…
Reference in a new issue