diff options
Diffstat (limited to 'apps/menus/display_menu.c')
-rw-r--r-- | apps/menus/display_menu.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c index 3e1443d02e..948dcede00 100644 --- a/apps/menus/display_menu.c +++ b/apps/menus/display_menu.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #endif | 43 | #endif |
44 | #include "viewport.h" | 44 | #include "viewport.h" |
45 | #include "statusbar.h" /* statusbar_vals enum*/ | 45 | #include "statusbar.h" /* statusbar_vals enum*/ |
46 | #include "rbunicode.h" | ||
46 | 47 | ||
47 | #ifdef HAVE_BACKLIGHT | 48 | #ifdef HAVE_BACKLIGHT |
48 | static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) | 49 | static int filterfirstkeypress_callback(int action,const struct menu_item_ex *this_item) |
@@ -524,8 +525,25 @@ MAKE_MENU(touchscreen_menu, ID2P(LANG_TOUCHSCREEN_SETTINGS), NULL, Icon_NOICON, | |||
524 | &touchscreen_menu_calibrate, &touchscreen_menu_reset_calibration); | 525 | &touchscreen_menu_calibrate, &touchscreen_menu_reset_calibration); |
525 | #endif | 526 | #endif |
526 | 527 | ||
528 | static int codepage_callback(int action, const struct menu_item_ex *this_item) | ||
529 | { | ||
530 | static int old_codepage; | ||
531 | int new_codepage = global_settings.default_codepage; | ||
532 | (void)this_item; | ||
533 | switch (action) | ||
534 | { | ||
535 | case ACTION_ENTER_MENUITEM: | ||
536 | old_codepage = new_codepage; | ||
537 | break; | ||
538 | case ACTION_EXIT_MENUITEM: | ||
539 | if (new_codepage != old_codepage) | ||
540 | set_codepage(new_codepage); | ||
541 | break; | ||
542 | } | ||
543 | return action; | ||
544 | } | ||
527 | 545 | ||
528 | MENUITEM_SETTING(codepage_setting, &global_settings.default_codepage, NULL); | 546 | MENUITEM_SETTING(codepage_setting, &global_settings.default_codepage, codepage_callback); |
529 | 547 | ||
530 | 548 | ||
531 | MAKE_MENU(display_menu, ID2P(LANG_DISPLAY), | 549 | MAKE_MENU(display_menu, ID2P(LANG_DISPLAY), |