diff options
Diffstat (limited to 'apps/settings.c')
-rw-r--r-- | apps/settings.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/apps/settings.c b/apps/settings.c index 6f1fe86f8e..01aacbcf6c 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -1590,7 +1590,7 @@ bool set_int(char* string, | |||
1590 | that 'variable' points to. not the value within. Only variables with | 1590 | that 'variable' points to. not the value within. Only variables with |
1591 | type 'bool' should use parameter BOOL. | 1591 | type 'bool' should use parameter BOOL. |
1592 | 1592 | ||
1593 | The type separation is nececssary since int and bool are fundamentally | 1593 | The type separation is necessary since int and bool are fundamentally |
1594 | different and bit-incompatible types and can not share the same access | 1594 | different and bit-incompatible types and can not share the same access |
1595 | code. */ | 1595 | code. */ |
1596 | 1596 | ||
@@ -1601,8 +1601,12 @@ bool set_option(char* string, void* variable, enum optiontype type, | |||
1601 | int button; | 1601 | int button; |
1602 | int* intvar = (int*)variable; | 1602 | int* intvar = (int*)variable; |
1603 | bool* boolvar = (bool*)variable; | 1603 | bool* boolvar = (bool*)variable; |
1604 | int orgint=*intvar; | 1604 | int oldval = 0; |
1605 | bool orgbool=*boolvar; | 1605 | |
1606 | if (type==INT) | ||
1607 | oldval=*intvar; | ||
1608 | else | ||
1609 | oldval=*boolvar; | ||
1606 | 1610 | ||
1607 | #ifdef HAVE_LCD_BITMAP | 1611 | #ifdef HAVE_LCD_BITMAP |
1608 | if(global_settings.statusbar) | 1612 | if(global_settings.statusbar) |
@@ -1672,12 +1676,12 @@ bool set_option(char* string, void* variable, enum optiontype type, | |||
1672 | case BUTTON_STOP: | 1676 | case BUTTON_STOP: |
1673 | case BUTTON_MENU: | 1677 | case BUTTON_MENU: |
1674 | #endif | 1678 | #endif |
1675 | if (((type==INT) && (*intvar != orgint)) || | 1679 | if (((type==INT) && (*intvar != oldval)) || |
1676 | ((type==BOOL) && (*boolvar != orgbool))) { | 1680 | ((type==BOOL) && (*boolvar != oldval))) { |
1677 | if (type==INT) | 1681 | if (type==INT) |
1678 | *intvar=orgint; | 1682 | *intvar=oldval; |
1679 | else | 1683 | else |
1680 | *boolvar=orgbool; | 1684 | *boolvar=oldval; |
1681 | lcd_stop_scroll(); | 1685 | lcd_stop_scroll(); |
1682 | lcd_puts(0, 0, str(LANG_MENU_SETTING_CANCEL)); | 1686 | lcd_puts(0, 0, str(LANG_MENU_SETTING_CANCEL)); |
1683 | lcd_update(); | 1687 | lcd_update(); |