summaryrefslogtreecommitdiff
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,
575 return false; 575 return false;
576} 576}
577 577
578int get_setting_info_for_bar(int setting_id, int *count, int *val)
579{
580 const struct settings_list *setting = &settings[setting_id];
581 int var_type = setting->flags&F_T_MASK;
582 void (*function)(int) = NULL;
583 int oldvalue;
584
585 if (var_type == F_T_INT || var_type == F_T_UINT)
586 {
587 oldvalue = *(int*)setting->setting;
588 }
589 else if (var_type == F_T_BOOL)
590 {
591 oldvalue = *(bool*)setting->setting?1:0;
592 }
593 else
594 {
595 *val = 0;
596 *count = 1;
597 return false; /* only int/bools can go here */
598 }
599
600 val_to_selection(setting, oldvalue, count, val, &function);
601 return true;
602}