diff --git a/apps/menu.c b/apps/menu.c index a45567415d..e1a5e99c68 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -494,13 +494,24 @@ bool do_setting_from_menu(const struct menu_item_ex *temp) } if (setting->flags&F_INT_SETTING) { + int min, max, step; + if (setting->flags&F_FLIPLIST) + { + min = setting->int_setting->max; + max = setting->int_setting->min; + step = -setting->int_setting->step; + } + else + { + max = setting->int_setting->max; + min = setting->int_setting->min; + step = setting->int_setting->step; + } set_int_ex(str(setting->lang_id), NULL, setting->int_setting->unit,var, setting->int_setting->option_callback, - setting->int_setting->step, - setting->int_setting->min, - setting->int_setting->max, + step, min, max, setting->int_setting->formatter, setting->int_setting->get_talk_id); } diff --git a/apps/settings_list.c b/apps/settings_list.c index a505232643..3203414afe 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c @@ -413,12 +413,12 @@ const struct settings_list settings[] = { MAX_CONTRAST_SETTING, 1, NULL, NULL}}}}, #endif #if CONFIG_BACKLIGHT - INT_SETTING_W_CFGVALS(0, backlight_timeout, LANG_BACKLIGHT, 6, + INT_SETTING_W_CFGVALS(F_FLIPLIST, backlight_timeout, LANG_BACKLIGHT, 6, "backlight timeout", backlight_times_conf, UNIT_SEC, 0, 18, 1, backlight_formatter, backlight_getlang, backlight_set_timeout), #if CONFIG_CHARGING - INT_SETTING_W_CFGVALS(0, backlight_timeout_plugged, + INT_SETTING_W_CFGVALS(F_FLIPLIST, backlight_timeout_plugged, LANG_BACKLIGHT_ON_WHEN_CHARGING, 11, "backlight timeout plugged", backlight_times_conf, UNIT_SEC, 0, 18, 1, backlight_formatter, backlight_getlang, @@ -449,7 +449,7 @@ const struct settings_list settings[] = { #endif /* HAVE_LCD_BITMAP */ OFFON_SETTING(0,show_icons, LANG_SHOW_ICONS ,true,"show icons", NULL), /* system */ - INT_SETTING_W_CFGVALS(0, poweroff, LANG_POWEROFF_IDLE, 10, "idle poweroff", + INT_SETTING_W_CFGVALS(F_FLIPLIST, poweroff, LANG_POWEROFF_IDLE, 10, "idle poweroff", "off,1,2,3,4,5,6,7,8,9,10,15,30,45,60", UNIT_MIN, 0, 14, 1, poweroff_idle_timer_formatter, poweroff_idle_timer_getlang, set_poweroff_timeout), @@ -502,12 +502,12 @@ const struct settings_list settings[] = { LANG_INVERT_LCD_INVERSE, LANG_INVERT_LCD_NORMAL, lcd_remote_set_invert_display), OFFON_SETTING(0,remote_flip_display, LANG_FLIP_DISPLAY, false,"remote flip display", NULL), - INT_SETTING_W_CFGVALS(0, remote_backlight_timeout, LANG_BACKLIGHT, 6, + INT_SETTING_W_CFGVALS(F_FLIPLIST, remote_backlight_timeout, LANG_BACKLIGHT, 6, "remote backlight timeout", backlight_times_conf, UNIT_SEC, 0, 18, 1, backlight_formatter, backlight_getlang, remote_backlight_set_timeout), #if CONFIG_CHARGING - INT_SETTING_W_CFGVALS(0, remote_backlight_timeout_plugged, LANG_BACKLIGHT, 11, + INT_SETTING_W_CFGVALS(F_FLIPLIST, remote_backlight_timeout_plugged, LANG_BACKLIGHT, 11, "remote backlight timeout plugged", backlight_times_conf, UNIT_SEC, 0, 18, 1, backlight_formatter, backlight_getlang, remote_backlight_set_timeout_plugged), @@ -600,7 +600,7 @@ const struct settings_list settings[] = { OFFON_SETTING(0,play_selected,LANG_PLAY_SELECTED,true,"play selected",NULL), OFFON_SETTING(0,party_mode,LANG_PARTY_MODE,false,"party mode",NULL), OFFON_SETTING(0,fade_on_stop,LANG_FADE_ON_STOP,true,"volume fade",NULL), - INT_SETTING_W_CFGVALS(0, ff_rewind_min_step, LANG_FFRW_STEP, FF_REWIND_1000, + INT_SETTING_W_CFGVALS(F_FLIPLIST, ff_rewind_min_step, LANG_FFRW_STEP, FF_REWIND_1000, "scan min step", "1,2,3,4,5,6,8,10,15,20,25,30,45,60", UNIT_SEC, 13, 0, -1, ff_rewind_min_step_formatter, ff_rewind_min_step_getlang, NULL), diff --git a/apps/settings_list.h b/apps/settings_list.h index e8d7be340a..061f20799f 100644 --- a/apps/settings_list.h +++ b/apps/settings_list.h @@ -102,9 +102,10 @@ struct choice_setting { - a NVRAM setting is removed */ #define F_TEMPVAR 0x400 /* used if the setting should be set using a temp var */ +#define F_FLIPLIST 0x800 /* used if the order in the setting screen is backwards */ struct settings_list { - uint32_t flags; /* ____ ____ TFFF ____ NNN_ _TVC IFRB STTT */ + uint32_t flags; /* ____ ____ TFFF ____ NNN_ FTVC IFRB STTT */ void *setting; int lang_id; /* -1 for none */ union storage_type default_val;