diff options
author | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-07-23 23:01:20 +0000 |
---|---|---|
committer | Jörg Hohensohn <hohensoh@rockbox.org> | 2004-07-23 23:01:20 +0000 |
commit | b1403ee024f81ced657261441571ee5e8bab71ce (patch) | |
tree | 3a7e1651d37bd35e801a331416654760cb61a075 /apps/settings_menu.c | |
parent | 15d04fdb00e7f94aef49cf9a70e73c5a46e21536 (diff) | |
download | rockbox-b1403ee024f81ced657261441571ee5e8bab71ce.tar.gz rockbox-b1403ee024f81ced657261441571ee5e8bab71ce.zip |
New way of defining menus and options allows to declare them static const, which saves the code to runtime-assemble them. Rockbox just got 6 KB smaller.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4931 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings_menu.c')
-rw-r--r-- | apps/settings_menu.c | 240 |
1 files changed, 120 insertions, 120 deletions
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 057191e603..5da733c1df 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -136,7 +136,7 @@ static bool flip_display(void) | |||
136 | */ | 136 | */ |
137 | static bool battery_type(void) | 137 | static bool battery_type(void) |
138 | { | 138 | { |
139 | struct opt_items names[] = { | 139 | static const struct opt_items names[] = { |
140 | { STR(LANG_DISPLAY_GRAPHIC) }, | 140 | { STR(LANG_DISPLAY_GRAPHIC) }, |
141 | { STR(LANG_DISPLAY_NUMERIC) } | 141 | { STR(LANG_DISPLAY_NUMERIC) } |
142 | }; | 142 | }; |
@@ -149,7 +149,7 @@ static bool battery_type(void) | |||
149 | */ | 149 | */ |
150 | static bool volume_type(void) | 150 | static bool volume_type(void) |
151 | { | 151 | { |
152 | struct opt_items names[] = { | 152 | static const struct opt_items names[] = { |
153 | { STR(LANG_DISPLAY_GRAPHIC) }, | 153 | { STR(LANG_DISPLAY_GRAPHIC) }, |
154 | { STR(LANG_DISPLAY_NUMERIC) } | 154 | { STR(LANG_DISPLAY_NUMERIC) } |
155 | }; | 155 | }; |
@@ -172,7 +172,7 @@ static bool peak_meter_fps_menu(void) { | |||
172 | */ | 172 | */ |
173 | static bool peak_meter_hold(void) { | 173 | static bool peak_meter_hold(void) { |
174 | bool retval = false; | 174 | bool retval = false; |
175 | struct opt_items names[] = { | 175 | static const struct opt_items names[] = { |
176 | { STR(LANG_OFF) }, | 176 | { STR(LANG_OFF) }, |
177 | { "200 ms " , TALK_ID(200, UNIT_MS) }, | 177 | { "200 ms " , TALK_ID(200, UNIT_MS) }, |
178 | { "300 ms " , TALK_ID(300, UNIT_MS) }, | 178 | { "300 ms " , TALK_ID(300, UNIT_MS) }, |
@@ -209,7 +209,7 @@ static bool peak_meter_hold(void) { | |||
209 | static bool peak_meter_clip_hold(void) { | 209 | static bool peak_meter_clip_hold(void) { |
210 | bool retval = false; | 210 | bool retval = false; |
211 | 211 | ||
212 | struct opt_items names[] = { | 212 | static const struct opt_items names[] = { |
213 | { STR(LANG_PM_ETERNAL) }, | 213 | { STR(LANG_PM_ETERNAL) }, |
214 | { "1s " , TALK_ID(1, UNIT_SEC) }, | 214 | { "1s " , TALK_ID(1, UNIT_SEC) }, |
215 | { "2s " , TALK_ID(2, UNIT_SEC) }, | 215 | { "2s " , TALK_ID(2, UNIT_SEC) }, |
@@ -409,17 +409,17 @@ static bool peak_meter_menu(void) | |||
409 | int m; | 409 | int m; |
410 | bool result; | 410 | bool result; |
411 | 411 | ||
412 | struct menu_item items[] = { | 412 | static const struct menu_item items[] = { |
413 | { STR(LANG_PM_RELEASE) , peak_meter_release }, | 413 | { ID2P(LANG_PM_RELEASE) , peak_meter_release }, |
414 | { STR(LANG_PM_PEAK_HOLD), peak_meter_hold }, | 414 | { ID2P(LANG_PM_PEAK_HOLD), peak_meter_hold }, |
415 | { STR(LANG_PM_CLIP_HOLD), peak_meter_clip_hold }, | 415 | { ID2P(LANG_PM_CLIP_HOLD), peak_meter_clip_hold }, |
416 | { STR(LANG_PM_PERFORMANCE), peak_meter_performance }, | 416 | { ID2P(LANG_PM_PERFORMANCE), peak_meter_performance }, |
417 | #ifdef PM_DEBUG | 417 | #ifdef PM_DEBUG |
418 | { "Refresh rate" , -1 , peak_meter_fps_menu }, | 418 | { "Refresh rate" , -1 , peak_meter_fps_menu }, |
419 | #endif | 419 | #endif |
420 | { STR(LANG_PM_SCALE) , peak_meter_scale }, | 420 | { ID2P(LANG_PM_SCALE) , peak_meter_scale }, |
421 | { STR(LANG_PM_MIN) , peak_meter_min }, | 421 | { ID2P(LANG_PM_MIN) , peak_meter_min }, |
422 | { STR(LANG_PM_MAX) , peak_meter_max }, | 422 | { ID2P(LANG_PM_MAX) , peak_meter_max }, |
423 | }; | 423 | }; |
424 | 424 | ||
425 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | 425 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
@@ -438,7 +438,7 @@ static bool shuffle(void) | |||
438 | static bool repeat_mode(void) | 438 | static bool repeat_mode(void) |
439 | { | 439 | { |
440 | bool result; | 440 | bool result; |
441 | struct opt_items names[] = { | 441 | static const struct opt_items names[] = { |
442 | { STR(LANG_OFF) }, | 442 | { STR(LANG_OFF) }, |
443 | { STR(LANG_REPEAT_ALL) }, | 443 | { STR(LANG_REPEAT_ALL) }, |
444 | { STR(LANG_REPEAT_ONE) } | 444 | { STR(LANG_REPEAT_ONE) } |
@@ -461,7 +461,7 @@ static bool play_selected(void) | |||
461 | 461 | ||
462 | static bool dir_filter(void) | 462 | static bool dir_filter(void) |
463 | { | 463 | { |
464 | struct opt_items names[] = { | 464 | static const struct opt_items names[] = { |
465 | { STR(LANG_FILTER_ALL) }, | 465 | { STR(LANG_FILTER_ALL) }, |
466 | { STR(LANG_FILTER_SUPPORTED) }, | 466 | { STR(LANG_FILTER_SUPPORTED) }, |
467 | { STR(LANG_FILTER_MUSIC) }, | 467 | { STR(LANG_FILTER_MUSIC) }, |
@@ -480,7 +480,7 @@ static bool sort_file(void) | |||
480 | { | 480 | { |
481 | int oldval = global_settings.sort_file; | 481 | int oldval = global_settings.sort_file; |
482 | bool ret; | 482 | bool ret; |
483 | struct opt_items names[] = { | 483 | static const struct opt_items names[] = { |
484 | { STR(LANG_SORT_ALPHA) }, | 484 | { STR(LANG_SORT_ALPHA) }, |
485 | { STR(LANG_SORT_DATE) }, | 485 | { STR(LANG_SORT_DATE) }, |
486 | { STR(LANG_SORT_DATE_REVERSE) }, | 486 | { STR(LANG_SORT_DATE_REVERSE) }, |
@@ -497,7 +497,7 @@ static bool sort_dir(void) | |||
497 | { | 497 | { |
498 | int oldval = global_settings.sort_dir; | 498 | int oldval = global_settings.sort_dir; |
499 | bool ret; | 499 | bool ret; |
500 | struct opt_items names[] = { | 500 | static const struct opt_items names[] = { |
501 | { STR(LANG_SORT_ALPHA) }, | 501 | { STR(LANG_SORT_ALPHA) }, |
502 | { STR(LANG_SORT_DATE) }, | 502 | { STR(LANG_SORT_DATE) }, |
503 | { STR(LANG_SORT_DATE_REVERSE) } | 503 | { STR(LANG_SORT_DATE_REVERSE) } |
@@ -511,7 +511,7 @@ static bool sort_dir(void) | |||
511 | 511 | ||
512 | static bool resume(void) | 512 | static bool resume(void) |
513 | { | 513 | { |
514 | struct opt_items names[] = { | 514 | static const struct opt_items names[] = { |
515 | { STR(LANG_SET_BOOL_NO) }, | 515 | { STR(LANG_SET_BOOL_NO) }, |
516 | { STR(LANG_RESUME_SETTING_ASK) }, | 516 | { STR(LANG_RESUME_SETTING_ASK) }, |
517 | { STR(LANG_RESUME_SETTING_ASK_ONCE) }, | 517 | { STR(LANG_RESUME_SETTING_ASK_ONCE) }, |
@@ -524,7 +524,7 @@ static bool resume(void) | |||
524 | static bool autocreatebookmark(void) | 524 | static bool autocreatebookmark(void) |
525 | { | 525 | { |
526 | bool retval = false; | 526 | bool retval = false; |
527 | struct opt_items names[] = { | 527 | static const struct opt_items names[] = { |
528 | { STR(LANG_SET_BOOL_NO) }, | 528 | { STR(LANG_SET_BOOL_NO) }, |
529 | { STR(LANG_SET_BOOL_YES) }, | 529 | { STR(LANG_SET_BOOL_YES) }, |
530 | { STR(LANG_RESUME_SETTING_ASK) }, | 530 | { STR(LANG_RESUME_SETTING_ASK) }, |
@@ -547,7 +547,7 @@ static bool autocreatebookmark(void) | |||
547 | 547 | ||
548 | static bool autoloadbookmark(void) | 548 | static bool autoloadbookmark(void) |
549 | { | 549 | { |
550 | struct opt_items names[] = { | 550 | static const struct opt_items names[] = { |
551 | { STR(LANG_SET_BOOL_NO) }, | 551 | { STR(LANG_SET_BOOL_NO) }, |
552 | { STR(LANG_SET_BOOL_YES) }, | 552 | { STR(LANG_SET_BOOL_YES) }, |
553 | { STR(LANG_RESUME_SETTING_ASK) } | 553 | { STR(LANG_RESUME_SETTING_ASK) } |
@@ -559,7 +559,7 @@ static bool autoloadbookmark(void) | |||
559 | 559 | ||
560 | static bool useMRB(void) | 560 | static bool useMRB(void) |
561 | { | 561 | { |
562 | struct opt_items names[] = { | 562 | static const struct opt_items names[] = { |
563 | { STR(LANG_SET_BOOL_NO) }, | 563 | { STR(LANG_SET_BOOL_NO) }, |
564 | { STR(LANG_SET_BOOL_YES) }, | 564 | { STR(LANG_SET_BOOL_YES) }, |
565 | { STR(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY) } | 565 | { STR(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY) } |
@@ -578,7 +578,7 @@ static bool backlight_on_when_charging(void) | |||
578 | 578 | ||
579 | static bool backlight_timer(void) | 579 | static bool backlight_timer(void) |
580 | { | 580 | { |
581 | struct opt_items names[] = { | 581 | static const struct opt_items names[] = { |
582 | { STR(LANG_OFF) }, | 582 | { STR(LANG_OFF) }, |
583 | { STR(LANG_ON) }, | 583 | { STR(LANG_ON) }, |
584 | { "1s ", TALK_ID(1, UNIT_SEC) }, | 584 | { "1s ", TALK_ID(1, UNIT_SEC) }, |
@@ -605,7 +605,7 @@ static bool backlight_timer(void) | |||
605 | 605 | ||
606 | static bool poweroff_idle_timer(void) | 606 | static bool poweroff_idle_timer(void) |
607 | { | 607 | { |
608 | struct opt_items names[] = { | 608 | static const struct opt_items names[] = { |
609 | { STR(LANG_OFF) }, | 609 | { STR(LANG_OFF) }, |
610 | { "1m ", TALK_ID(1, UNIT_MIN) }, | 610 | { "1m ", TALK_ID(1, UNIT_MIN) }, |
611 | { "2m ", TALK_ID(2, UNIT_MIN) }, | 611 | { "2m ", TALK_ID(2, UNIT_MIN) }, |
@@ -663,7 +663,7 @@ static bool bidir_limit(void) | |||
663 | #ifdef HAVE_LCD_CHARCELLS | 663 | #ifdef HAVE_LCD_CHARCELLS |
664 | static bool jump_scroll(void) | 664 | static bool jump_scroll(void) |
665 | { | 665 | { |
666 | struct opt_items names[] = { | 666 | static const struct opt_items names[] = { |
667 | { STR(LANG_OFF) }, | 667 | { STR(LANG_OFF) }, |
668 | { STR(LANG_ONE_TIME) }, | 668 | { STR(LANG_ONE_TIME) }, |
669 | { "2", TALK_ID(2, UNIT_INT) }, | 669 | { "2", TALK_ID(2, UNIT_INT) }, |
@@ -758,7 +758,7 @@ static bool timedate_set(void) | |||
758 | 758 | ||
759 | static bool timeformat_set(void) | 759 | static bool timeformat_set(void) |
760 | { | 760 | { |
761 | struct opt_items names[] = { | 761 | static const struct opt_items names[] = { |
762 | { STR(LANG_24_HOUR_CLOCK) }, | 762 | { STR(LANG_24_HOUR_CLOCK) }, |
763 | { STR(LANG_12_HOUR_CLOCK) } | 763 | { STR(LANG_12_HOUR_CLOCK) } |
764 | }; | 764 | }; |
@@ -815,7 +815,7 @@ static bool buffer_margin(void) | |||
815 | 815 | ||
816 | static bool ff_rewind_min_step(void) | 816 | static bool ff_rewind_min_step(void) |
817 | { | 817 | { |
818 | struct opt_items names[] = { | 818 | static const struct opt_items names[] = { |
819 | { "1s", TALK_ID(1, UNIT_SEC) }, | 819 | { "1s", TALK_ID(1, UNIT_SEC) }, |
820 | { "2s", TALK_ID(2, UNIT_SEC) }, | 820 | { "2s", TALK_ID(2, UNIT_SEC) }, |
821 | { "3s", TALK_ID(3, UNIT_SEC) }, | 821 | { "3s", TALK_ID(3, UNIT_SEC) }, |
@@ -843,7 +843,7 @@ static bool set_fade_on_stop(void) | |||
843 | 843 | ||
844 | static bool ff_rewind_accel(void) | 844 | static bool ff_rewind_accel(void) |
845 | { | 845 | { |
846 | struct opt_items names[] = { | 846 | static const struct opt_items names[] = { |
847 | { STR(LANG_OFF) }, | 847 | { STR(LANG_OFF) }, |
848 | { "2x/1s", TALK_ID(1, UNIT_SEC) }, | 848 | { "2x/1s", TALK_ID(1, UNIT_SEC) }, |
849 | { "2x/2s", TALK_ID(2, UNIT_SEC) }, | 849 | { "2x/2s", TALK_ID(2, UNIT_SEC) }, |
@@ -899,7 +899,7 @@ static bool voice_menus(void) | |||
899 | 899 | ||
900 | static bool voice_dirs(void) | 900 | static bool voice_dirs(void) |
901 | { | 901 | { |
902 | struct opt_items names[] = { | 902 | static const struct opt_items names[] = { |
903 | { STR(LANG_OFF) }, | 903 | { STR(LANG_OFF) }, |
904 | { STR(LANG_VOICE_NUMBER) }, | 904 | { STR(LANG_VOICE_NUMBER) }, |
905 | { STR(LANG_VOICE_SPELL) }, | 905 | { STR(LANG_VOICE_SPELL) }, |
@@ -912,7 +912,7 @@ static bool voice_dirs(void) | |||
912 | 912 | ||
913 | static bool voice_files(void) | 913 | static bool voice_files(void) |
914 | { | 914 | { |
915 | struct opt_items names[] = { | 915 | static const struct opt_items names[] = { |
916 | { STR(LANG_OFF) }, | 916 | { STR(LANG_OFF) }, |
917 | { STR(LANG_VOICE_NUMBER) }, | 917 | { STR(LANG_VOICE_NUMBER) }, |
918 | { STR(LANG_VOICE_SPELL) } | 918 | { STR(LANG_VOICE_SPELL) } |
@@ -926,10 +926,10 @@ static bool voice_menu(void) | |||
926 | int m; | 926 | int m; |
927 | bool result; | 927 | bool result; |
928 | 928 | ||
929 | struct menu_item items[] = { | 929 | static const struct menu_item items[] = { |
930 | { STR(LANG_VOICE_MENU), voice_menus }, | 930 | { ID2P(LANG_VOICE_MENU), voice_menus }, |
931 | { STR(LANG_VOICE_DIR), voice_dirs }, | 931 | { ID2P(LANG_VOICE_DIR), voice_dirs }, |
932 | { STR(LANG_VOICE_FILE), voice_files } | 932 | { ID2P(LANG_VOICE_FILE), voice_files } |
933 | }; | 933 | }; |
934 | 934 | ||
935 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | 935 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
@@ -966,9 +966,9 @@ static bool ff_rewind_settings_menu(void) | |||
966 | int m; | 966 | int m; |
967 | bool result; | 967 | bool result; |
968 | 968 | ||
969 | struct menu_item items[] = { | 969 | static const struct menu_item items[] = { |
970 | { STR(LANG_FFRW_STEP), ff_rewind_min_step }, | 970 | { ID2P(LANG_FFRW_STEP), ff_rewind_min_step }, |
971 | { STR(LANG_FFRW_ACCEL), ff_rewind_accel }, | 971 | { ID2P(LANG_FFRW_ACCEL), ff_rewind_accel }, |
972 | }; | 972 | }; |
973 | 973 | ||
974 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | 974 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
@@ -984,14 +984,14 @@ static bool playback_settings_menu(void) | |||
984 | int m; | 984 | int m; |
985 | bool result; | 985 | bool result; |
986 | 986 | ||
987 | struct menu_item items[] = { | 987 | static const struct menu_item items[] = { |
988 | { STR(LANG_SHUFFLE), shuffle }, | 988 | { ID2P(LANG_SHUFFLE), shuffle }, |
989 | { STR(LANG_REPEAT), repeat_mode }, | 989 | { ID2P(LANG_REPEAT), repeat_mode }, |
990 | { STR(LANG_PLAY_SELECTED), play_selected }, | 990 | { ID2P(LANG_PLAY_SELECTED), play_selected }, |
991 | { STR(LANG_RESUME), resume }, | 991 | { ID2P(LANG_RESUME), resume }, |
992 | { STR(LANG_WIND_MENU), ff_rewind_settings_menu }, | 992 | { ID2P(LANG_WIND_MENU), ff_rewind_settings_menu }, |
993 | { STR(LANG_MP3BUFFER_MARGIN), buffer_margin }, | 993 | { ID2P(LANG_MP3BUFFER_MARGIN), buffer_margin }, |
994 | { STR(LANG_FADE_ON_STOP), set_fade_on_stop }, | 994 | { ID2P(LANG_FADE_ON_STOP), set_fade_on_stop }, |
995 | }; | 995 | }; |
996 | 996 | ||
997 | bool old_shuffle = global_settings.playlist_shuffle; | 997 | bool old_shuffle = global_settings.playlist_shuffle; |
@@ -1020,10 +1020,10 @@ static bool bookmark_settings_menu(void) | |||
1020 | int m; | 1020 | int m; |
1021 | bool result; | 1021 | bool result; |
1022 | 1022 | ||
1023 | struct menu_item items[] = { | 1023 | static const struct menu_item items[] = { |
1024 | { STR(LANG_BOOKMARK_SETTINGS_AUTOCREATE), autocreatebookmark}, | 1024 | { ID2P(LANG_BOOKMARK_SETTINGS_AUTOCREATE), autocreatebookmark}, |
1025 | { STR(LANG_BOOKMARK_SETTINGS_AUTOLOAD), autoloadbookmark}, | 1025 | { ID2P(LANG_BOOKMARK_SETTINGS_AUTOLOAD), autoloadbookmark}, |
1026 | { STR(LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS), useMRB}, | 1026 | { ID2P(LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS), useMRB}, |
1027 | }; | 1027 | }; |
1028 | 1028 | ||
1029 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | 1029 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
@@ -1088,13 +1088,13 @@ static bool fileview_settings_menu(void) | |||
1088 | int m; | 1088 | int m; |
1089 | bool result; | 1089 | bool result; |
1090 | 1090 | ||
1091 | struct menu_item items[] = { | 1091 | static const struct menu_item items[] = { |
1092 | { STR(LANG_SORT_CASE), sort_case }, | 1092 | { ID2P(LANG_SORT_CASE), sort_case }, |
1093 | { STR(LANG_SORT_DIR), sort_dir }, | 1093 | { ID2P(LANG_SORT_DIR), sort_dir }, |
1094 | { STR(LANG_SORT_FILE), sort_file }, | 1094 | { ID2P(LANG_SORT_FILE), sort_file }, |
1095 | { STR(LANG_FILTER), dir_filter }, | 1095 | { ID2P(LANG_FILTER), dir_filter }, |
1096 | { STR(LANG_FOLLOW), browse_current }, | 1096 | { ID2P(LANG_FOLLOW), browse_current }, |
1097 | { STR(LANG_SHOW_ICONS), show_icons }, | 1097 | { ID2P(LANG_SHOW_ICONS), show_icons }, |
1098 | }; | 1098 | }; |
1099 | 1099 | ||
1100 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | 1100 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
@@ -1110,16 +1110,16 @@ static bool scroll_settings_menu(void) | |||
1110 | int m; | 1110 | int m; |
1111 | bool result; | 1111 | bool result; |
1112 | 1112 | ||
1113 | struct menu_item items[] = { | 1113 | static const struct menu_item items[] = { |
1114 | { STR(LANG_SCROLL_SPEED), scroll_speed }, | 1114 | { ID2P(LANG_SCROLL_SPEED), scroll_speed }, |
1115 | { STR(LANG_SCROLL_DELAY), scroll_delay }, | 1115 | { ID2P(LANG_SCROLL_DELAY), scroll_delay }, |
1116 | #ifdef HAVE_LCD_BITMAP | 1116 | #ifdef HAVE_LCD_BITMAP |
1117 | { STR(LANG_SCROLL_STEP), scroll_step }, | 1117 | { ID2P(LANG_SCROLL_STEP), scroll_step }, |
1118 | #endif | 1118 | #endif |
1119 | { STR(LANG_BIDIR_SCROLL), bidir_limit }, | 1119 | { ID2P(LANG_BIDIR_SCROLL), bidir_limit }, |
1120 | #ifdef HAVE_LCD_CHARCELLS | 1120 | #ifdef HAVE_LCD_CHARCELLS |
1121 | { STR(LANG_JUMP_SCROLL), jump_scroll }, | 1121 | { ID2P(LANG_JUMP_SCROLL), jump_scroll }, |
1122 | { STR(LANG_JUMP_SCROLL_DELAY), jump_scroll_delay }, | 1122 | { ID2P(LANG_JUMP_SCROLL_DELAY), jump_scroll_delay }, |
1123 | #endif | 1123 | #endif |
1124 | }; | 1124 | }; |
1125 | 1125 | ||
@@ -1135,15 +1135,15 @@ static bool lcd_settings_menu(void) | |||
1135 | int m; | 1135 | int m; |
1136 | bool result; | 1136 | bool result; |
1137 | 1137 | ||
1138 | struct menu_item items[] = { | 1138 | static const struct menu_item items[] = { |
1139 | { STR(LANG_BACKLIGHT), backlight_timer }, | 1139 | { ID2P(LANG_BACKLIGHT), backlight_timer }, |
1140 | { STR(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging }, | 1140 | { ID2P(LANG_BACKLIGHT_ON_WHEN_CHARGING), backlight_on_when_charging }, |
1141 | { STR(LANG_CAPTION_BACKLIGHT), caption_backlight }, | 1141 | { ID2P(LANG_CAPTION_BACKLIGHT), caption_backlight }, |
1142 | { STR(LANG_CONTRAST), contrast }, | 1142 | { ID2P(LANG_CONTRAST), contrast }, |
1143 | #ifdef HAVE_LCD_BITMAP | 1143 | #ifdef HAVE_LCD_BITMAP |
1144 | { STR(LANG_INVERT), invert }, | 1144 | { ID2P(LANG_INVERT), invert }, |
1145 | { STR(LANG_FLIP_DISPLAY), flip_display }, | 1145 | { ID2P(LANG_FLIP_DISPLAY), flip_display }, |
1146 | { STR(LANG_INVERT_CURSOR), invert_cursor }, | 1146 | { ID2P(LANG_INVERT_CURSOR), invert_cursor }, |
1147 | #endif | 1147 | #endif |
1148 | }; | 1148 | }; |
1149 | 1149 | ||
@@ -1160,12 +1160,12 @@ static bool bars_settings_menu(void) | |||
1160 | int m; | 1160 | int m; |
1161 | bool result; | 1161 | bool result; |
1162 | 1162 | ||
1163 | struct menu_item items[] = { | 1163 | static const struct menu_item items[] = { |
1164 | { STR(LANG_SCROLL_BAR), scroll_bar }, | 1164 | { ID2P(LANG_SCROLL_BAR), scroll_bar }, |
1165 | { STR(LANG_STATUS_BAR), status_bar }, | 1165 | { ID2P(LANG_STATUS_BAR), status_bar }, |
1166 | { STR(LANG_BUTTON_BAR), button_bar }, | 1166 | { ID2P(LANG_BUTTON_BAR), button_bar }, |
1167 | { STR(LANG_VOLUME_DISPLAY), volume_type }, | 1167 | { ID2P(LANG_VOLUME_DISPLAY), volume_type }, |
1168 | { STR(LANG_BATTERY_DISPLAY), battery_type }, | 1168 | { ID2P(LANG_BATTERY_DISPLAY), battery_type }, |
1169 | }; | 1169 | }; |
1170 | 1170 | ||
1171 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | 1171 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
@@ -1182,16 +1182,16 @@ static bool display_settings_menu(void) | |||
1182 | int m; | 1182 | int m; |
1183 | bool result; | 1183 | bool result; |
1184 | 1184 | ||
1185 | struct menu_item items[] = { | 1185 | static const struct menu_item items[] = { |
1186 | #ifdef HAVE_LCD_BITMAP | 1186 | #ifdef HAVE_LCD_BITMAP |
1187 | { STR(LANG_CUSTOM_FONT), font_browse }, | 1187 | { ID2P(LANG_CUSTOM_FONT), font_browse }, |
1188 | #endif | 1188 | #endif |
1189 | { STR(LANG_WHILE_PLAYING), custom_wps_browse }, | 1189 | { ID2P(LANG_WHILE_PLAYING), custom_wps_browse }, |
1190 | { STR(LANG_LCD_MENU), lcd_settings_menu }, | 1190 | { ID2P(LANG_LCD_MENU), lcd_settings_menu }, |
1191 | { STR(LANG_SCROLL_MENU), scroll_settings_menu }, | 1191 | { ID2P(LANG_SCROLL_MENU), scroll_settings_menu }, |
1192 | #ifdef HAVE_LCD_BITMAP | 1192 | #ifdef HAVE_LCD_BITMAP |
1193 | { STR(LANG_BARS_MENU), bars_settings_menu }, | 1193 | { ID2P(LANG_BARS_MENU), bars_settings_menu }, |
1194 | { STR(LANG_PM_MENU), peak_meter_menu }, | 1194 | { ID2P(LANG_PM_MENU), peak_meter_menu }, |
1195 | #endif | 1195 | #endif |
1196 | }; | 1196 | }; |
1197 | 1197 | ||
@@ -1213,16 +1213,16 @@ static bool battery_settings_menu(void) | |||
1213 | int m; | 1213 | int m; |
1214 | bool result; | 1214 | bool result; |
1215 | 1215 | ||
1216 | struct menu_item items[] = { | 1216 | static const struct menu_item items[] = { |
1217 | #ifdef HAVE_CHARGE_CTRL | 1217 | #ifdef HAVE_CHARGE_CTRL |
1218 | { STR(LANG_DISCHARGE), deep_discharge }, | 1218 | { ID2P(LANG_DISCHARGE), deep_discharge }, |
1219 | { STR(LANG_TRICKLE_CHARGE), trickle_charge }, | 1219 | { ID2P(LANG_TRICKLE_CHARGE), trickle_charge }, |
1220 | #endif | 1220 | #endif |
1221 | #ifndef SIMULATOR | 1221 | #ifndef SIMULATOR |
1222 | { STR(LANG_BATTERY_CAPACITY), battery_capacity }, | 1222 | { ID2P(LANG_BATTERY_CAPACITY), battery_capacity }, |
1223 | #else | 1223 | #else |
1224 | #ifndef HAVE_CHARGE_CTRL | 1224 | #ifndef HAVE_CHARGE_CTRL |
1225 | { "Dummy", -1, NULL }, /* to have an entry at all, in the simulator */ | 1225 | { "Dummy", NULL }, /* to have an entry at all, in the simulator */ |
1226 | #endif | 1226 | #endif |
1227 | #endif | 1227 | #endif |
1228 | }; | 1228 | }; |
@@ -1239,10 +1239,10 @@ static bool disk_settings_menu(void) | |||
1239 | int m; | 1239 | int m; |
1240 | bool result; | 1240 | bool result; |
1241 | 1241 | ||
1242 | struct menu_item items[] = { | 1242 | static const struct menu_item items[] = { |
1243 | { STR(LANG_SPINDOWN), spindown }, | 1243 | { ID2P(LANG_SPINDOWN), spindown }, |
1244 | #ifdef HAVE_ATA_POWER_OFF | 1244 | #ifdef HAVE_ATA_POWER_OFF |
1245 | { STR(LANG_POWEROFF), poweroff }, | 1245 | { ID2P(LANG_POWEROFF), poweroff }, |
1246 | #endif | 1246 | #endif |
1247 | }; | 1247 | }; |
1248 | 1248 | ||
@@ -1259,9 +1259,9 @@ static bool time_settings_menu(void) | |||
1259 | int m; | 1259 | int m; |
1260 | bool result; | 1260 | bool result; |
1261 | 1261 | ||
1262 | struct menu_item items[] = { | 1262 | static const struct menu_item items[] = { |
1263 | { STR(LANG_TIME), timedate_set }, | 1263 | { ID2P(LANG_TIME), timedate_set }, |
1264 | { STR(LANG_TIMEFORMAT), timeformat_set }, | 1264 | { ID2P(LANG_TIMEFORMAT), timeformat_set }, |
1265 | }; | 1265 | }; |
1266 | 1266 | ||
1267 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | 1267 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
@@ -1277,11 +1277,11 @@ static bool manage_settings_menu(void) | |||
1277 | int m; | 1277 | int m; |
1278 | bool result; | 1278 | bool result; |
1279 | 1279 | ||
1280 | struct menu_item items[] = { | 1280 | static const struct menu_item items[] = { |
1281 | { STR(LANG_CUSTOM_CFG), custom_cfg_browse }, | 1281 | { ID2P(LANG_CUSTOM_CFG), custom_cfg_browse }, |
1282 | { STR(LANG_FIRMWARE), firmware_browse }, | 1282 | { ID2P(LANG_FIRMWARE), firmware_browse }, |
1283 | { STR(LANG_RESET), reset_settings }, | 1283 | { ID2P(LANG_RESET), reset_settings }, |
1284 | { STR(LANG_SAVE_SETTINGS), settings_save_config }, | 1284 | { ID2P(LANG_SAVE_SETTINGS), settings_save_config }, |
1285 | }; | 1285 | }; |
1286 | 1286 | ||
1287 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | 1287 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
@@ -1296,9 +1296,9 @@ static bool limits_settings_menu(void) | |||
1296 | int m; | 1296 | int m; |
1297 | bool result; | 1297 | bool result; |
1298 | 1298 | ||
1299 | struct menu_item items[] = { | 1299 | static const struct menu_item items[] = { |
1300 | { STR(LANG_MAX_FILES_IN_DIR), max_files_in_dir }, | 1300 | { ID2P(LANG_MAX_FILES_IN_DIR), max_files_in_dir }, |
1301 | { STR(LANG_MAX_FILES_IN_PLAYLIST), max_files_in_playlist }, | 1301 | { ID2P(LANG_MAX_FILES_IN_PLAYLIST), max_files_in_playlist }, |
1302 | }; | 1302 | }; |
1303 | 1303 | ||
1304 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | 1304 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
@@ -1314,23 +1314,23 @@ static bool system_settings_menu(void) | |||
1314 | int m; | 1314 | int m; |
1315 | bool result; | 1315 | bool result; |
1316 | 1316 | ||
1317 | struct menu_item items[] = { | 1317 | static const struct menu_item items[] = { |
1318 | { STR(LANG_BATTERY_MENU), battery_settings_menu }, | 1318 | { ID2P(LANG_BATTERY_MENU), battery_settings_menu }, |
1319 | { STR(LANG_DISK_MENU), disk_settings_menu }, | 1319 | { ID2P(LANG_DISK_MENU), disk_settings_menu }, |
1320 | #ifdef HAVE_RTC | 1320 | #ifdef HAVE_RTC |
1321 | { STR(LANG_TIME_MENU), time_settings_menu }, | 1321 | { ID2P(LANG_TIME_MENU), time_settings_menu }, |
1322 | #endif | 1322 | #endif |
1323 | { STR(LANG_POWEROFF_IDLE), poweroff_idle_timer }, | 1323 | { ID2P(LANG_POWEROFF_IDLE), poweroff_idle_timer }, |
1324 | { STR(LANG_SLEEP_TIMER), sleeptimer_screen }, | 1324 | { ID2P(LANG_SLEEP_TIMER), sleeptimer_screen }, |
1325 | #ifdef HAVE_ALARM_MOD | 1325 | #ifdef HAVE_ALARM_MOD |
1326 | { STR(LANG_ALARM_MOD_ALARM_MENU), alarm_screen }, | 1326 | { ID2P(LANG_ALARM_MOD_ALARM_MENU), alarm_screen }, |
1327 | #endif | 1327 | #endif |
1328 | { STR(LANG_LIMITS_MENU), limits_settings_menu }, | 1328 | { ID2P(LANG_LIMITS_MENU), limits_settings_menu }, |
1329 | #ifdef HAVE_MAS3507D | 1329 | #ifdef HAVE_MAS3507D |
1330 | { STR(LANG_LINE_IN), line_in }, | 1330 | { ID2P(LANG_LINE_IN), line_in }, |
1331 | #endif | 1331 | #endif |
1332 | { STR(LANG_CAR_ADAPTER_MODE), car_adapter_mode }, | 1332 | { ID2P(LANG_CAR_ADAPTER_MODE), car_adapter_mode }, |
1333 | { STR(LANG_MANAGE_MENU), manage_settings_menu }, | 1333 | { ID2P(LANG_MANAGE_MENU), manage_settings_menu }, |
1334 | }; | 1334 | }; |
1335 | 1335 | ||
1336 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | 1336 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |
@@ -1345,14 +1345,14 @@ bool settings_menu(void) | |||
1345 | int m; | 1345 | int m; |
1346 | bool result; | 1346 | bool result; |
1347 | 1347 | ||
1348 | struct menu_item items[] = { | 1348 | static const struct menu_item items[] = { |
1349 | { STR(LANG_PLAYBACK), playback_settings_menu }, | 1349 | { ID2P(LANG_PLAYBACK), playback_settings_menu }, |
1350 | { STR(LANG_FILE), fileview_settings_menu }, | 1350 | { ID2P(LANG_FILE), fileview_settings_menu }, |
1351 | { STR(LANG_DISPLAY), display_settings_menu }, | 1351 | { ID2P(LANG_DISPLAY), display_settings_menu }, |
1352 | { STR(LANG_SYSTEM), system_settings_menu }, | 1352 | { ID2P(LANG_SYSTEM), system_settings_menu }, |
1353 | { STR(LANG_BOOKMARK_SETTINGS),bookmark_settings_menu }, | 1353 | { ID2P(LANG_BOOKMARK_SETTINGS),bookmark_settings_menu }, |
1354 | { STR(LANG_LANGUAGE), language_browse }, | 1354 | { ID2P(LANG_LANGUAGE), language_browse }, |
1355 | { STR(LANG_VOICE), voice_menu }, | 1355 | { ID2P(LANG_VOICE), voice_menu }, |
1356 | }; | 1356 | }; |
1357 | 1357 | ||
1358 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | 1358 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, |