summaryrefslogtreecommitdiffstats
path: root/apps/gui/option_select.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/option_select.c')
-rw-r--r--apps/gui/option_select.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c
index ca206b86da..f85570d699 100644
--- a/apps/gui/option_select.c
+++ b/apps/gui/option_select.c
@@ -575,3 +575,28 @@ bool option_screen(const struct settings_list *setting,
return false;
}
+int get_setting_info_for_bar(int setting_id, int *count, int *val)
+{
+ const struct settings_list *setting = &settings[setting_id];
+ int var_type = setting->flags&F_T_MASK;
+ void (*function)(int) = NULL;
+ int oldvalue;
+
+ if (var_type == F_T_INT || var_type == F_T_UINT)
+ {
+ oldvalue = *(int*)setting->setting;
+ }
+ else if (var_type == F_T_BOOL)
+ {
+ oldvalue = *(bool*)setting->setting?1:0;
+ }
+ else
+ {
+ *val = 0;
+ *count = 1;
+ return false; /* only int/bools can go here */
+ }
+
+ val_to_selection(setting, oldvalue, count, val, &function);
+ return true;
+}