diff options
Diffstat (limited to 'apps/gui/option_select.c')
-rw-r--r-- | apps/gui/option_select.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index 8839f42e42..d7f27f64eb 100644 --- a/apps/gui/option_select.c +++ b/apps/gui/option_select.c | |||
@@ -470,7 +470,10 @@ bool option_screen(const struct settings_list *setting, | |||
470 | int *variable; | 470 | int *variable; |
471 | bool allow_wrap = setting->flags & F_NO_WRAP ? false : true; | 471 | bool allow_wrap = setting->flags & F_NO_WRAP ? false : true; |
472 | bool cb_on_select_only = | 472 | bool cb_on_select_only = |
473 | ((setting->flags & F_CB_ON_SELECT_ONLY) == F_CB_ON_SELECT_ONLY); | 473 | ((setting->flags & F_CB_ON_SELECT_ONLY) == F_CB_ON_SELECT_ONLY); |
474 | bool cb_on_changed = | ||
475 | ((setting->flags & F_CB_ON_SELECT_ONLY_IF_CHANGED) == F_CB_ON_SELECT_ONLY_IF_CHANGED); | ||
476 | |||
474 | int var_type = setting->flags&F_T_MASK; | 477 | int var_type = setting->flags&F_T_MASK; |
475 | void (*function)(int) = NULL; | 478 | void (*function)(int) = NULL; |
476 | char *title; | 479 | char *title; |
@@ -561,8 +564,12 @@ bool option_screen(const struct settings_list *setting, | |||
561 | } | 564 | } |
562 | settings_save(); | 565 | settings_save(); |
563 | done = true; | 566 | done = true; |
567 | |||
564 | if (cb_on_select_only && function) | 568 | if (cb_on_select_only && function) |
565 | function(*variable); | 569 | { |
570 | if (!cb_on_changed || (*variable != oldvalue)) | ||
571 | function(*variable); | ||
572 | } | ||
566 | } | 573 | } |
567 | else if(default_event_handler(action) == SYS_USB_CONNECTED) | 574 | else if(default_event_handler(action) == SYS_USB_CONNECTED) |
568 | { | 575 | { |