From cebfead151fad2eea57f7410ae4615efe109ae3c Mon Sep 17 00:00:00 2001 From: alle Date: Wed, 19 Aug 2009 09:53:57 +0000 Subject: [PATCH] More comments in the settings macros git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22423 a1c6a512-1295-4272-9138-f99709370657 --- apps/settings_list.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/apps/settings_list.c b/apps/settings_list.c index 3d3b888c2..b43e9ce4e 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -76,8 +76,10 @@ - lang_id: LANG_* id to display in menus and setting screens for the setting - default: the default value for the variable, set if settings are reset - name: the name of the setting in config files - - cfg_vals: comma seperated list of legal values in cfg files. - NULL if a number is written to the file instead. + - cfg_vals: comma separated list of legal values to write to cfg files. + The values correspond to the values 0,1,2,etc. of the setting. + NULL if just the number itself should be written to the file. + No spaces between the values and the commas! - cb: the callback used by the setting screen. */ @@ -91,15 +93,17 @@ or dont save as "off" or "on" in the cfg. cfgvals are comma separated values (without spaces after the comma!) to write for 'false' and 'true' (in this order) + yes_id is the lang_id for the 'yes' (or 'on') option in the menu + no_id is the lang_id for the 'no' (or 'off') option in the menu */ -#define BOOL_SETTING(flags,var,lang_id,default,name,cfgvals,yes,no,cb) \ +#define BOOL_SETTING(flags,var,lang_id,default,name,cfgvals,yes_id,no_id,cb)\ {flags|F_BOOL_SETTING, &global_settings.var, \ lang_id, BOOL(default),name,cfgvals, \ - {.bool_setting=(struct bool_setting[]){{cb,yes,no}}} } + {.bool_setting=(struct bool_setting[]){{cb,yes_id,no_id}}} } /* bool setting which does use LANG_YES and _NO and save as "off,on" */ #define OFFON_SETTING(flags,var,lang_id,default,name,cb) \ - BOOL_SETTING(flags,var,lang_id,default,name,off_on, \ + BOOL_SETTING(flags,var,lang_id,default,name,off_on, \ LANG_SET_BOOL_YES,LANG_SET_BOOL_NO,cb) /* int variable which is NOT saved to .cfg files, -- 2.11.4.GIT