diff options
Diffstat (limited to 'apps/settings_menu.c')
-rw-r--r-- | apps/settings_menu.c | 648 |
1 files changed, 0 insertions, 648 deletions
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 79c4d9d6e5..67a5abaa67 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -66,9 +66,6 @@ | |||
66 | #if CONFIG_CODEC == MAS3507D | 66 | #if CONFIG_CODEC == MAS3507D |
67 | void dac_line_in(bool enable); | 67 | void dac_line_in(bool enable); |
68 | #endif | 68 | #endif |
69 | #ifdef HAVE_ALARM_MOD | ||
70 | #include "alarm_menu.h" | ||
71 | #endif | ||
72 | 69 | ||
73 | #ifdef HAVE_REMOTE_LCD | 70 | #ifdef HAVE_REMOTE_LCD |
74 | #include "lcd-remote.h" | 71 | #include "lcd-remote.h" |
@@ -85,34 +82,6 @@ void dac_line_in(bool enable); | |||
85 | #endif | 82 | #endif |
86 | #include "menus/exported_menus.h" | 83 | #include "menus/exported_menus.h" |
87 | 84 | ||
88 | #ifdef CONFIG_CHARGING | ||
89 | static bool car_adapter_mode(void) | ||
90 | { | ||
91 | return set_bool( str(LANG_CAR_ADAPTER_MODE), | ||
92 | &global_settings.car_adapter_mode ); | ||
93 | } | ||
94 | #endif | ||
95 | |||
96 | /** | ||
97 | * Menu to set icon visibility | ||
98 | */ | ||
99 | static bool show_icons(void) | ||
100 | { | ||
101 | return set_bool( (char *)str(LANG_SHOW_ICONS), &global_settings.show_icons ); | ||
102 | } | ||
103 | |||
104 | static bool show_path(void) | ||
105 | { | ||
106 | static const struct opt_items names[3] = { | ||
107 | { STR(LANG_OFF) }, | ||
108 | { STR(LANG_SHOW_PATH_CURRENT) }, | ||
109 | { STR(LANG_SHOW_PATH_FULL) }, | ||
110 | }; | ||
111 | |||
112 | return set_option(str(LANG_SHOW_PATH), | ||
113 | &global_settings.show_path_in_browser, | ||
114 | INT, names, 3, NULL); | ||
115 | } | ||
116 | 85 | ||
117 | /** | 86 | /** |
118 | * Menu to set the option to scroll paginated | 87 | * Menu to set the option to scroll paginated |
@@ -451,22 +420,6 @@ static bool reset_color(void) | |||
451 | } | 420 | } |
452 | #endif | 421 | #endif |
453 | 422 | ||
454 | #ifdef HAVE_USB_POWER | ||
455 | #ifdef CONFIG_CHARGING | ||
456 | /** | ||
457 | * Menu to switch the USB charging on or off | ||
458 | */ | ||
459 | static bool usb_charging(void) | ||
460 | { | ||
461 | bool rc = set_bool(str(LANG_USB_CHARGING), | ||
462 | &global_settings.usb_charging); | ||
463 | /* if (usb_charging_enabled() != global_settings.usb_charging) */ | ||
464 | usb_charging_enable(global_settings.usb_charging); | ||
465 | return rc; | ||
466 | } | ||
467 | #endif | ||
468 | #endif | ||
469 | |||
470 | /** | 423 | /** |
471 | * Menu to configure the battery display on status bar | 424 | * Menu to configure the battery display on status bar |
472 | */ | 425 | */ |
@@ -734,164 +687,6 @@ static bool peak_meter_menu(void) | |||
734 | } | 687 | } |
735 | #endif /* HAVE_LCD_BITMAP */ | 688 | #endif /* HAVE_LCD_BITMAP */ |
736 | 689 | ||
737 | static bool dir_filter(void) | ||
738 | { | ||
739 | static const struct opt_items names[] = { | ||
740 | { STR(LANG_FILTER_ALL) }, | ||
741 | { STR(LANG_FILTER_SUPPORTED) }, | ||
742 | { STR(LANG_FILTER_MUSIC) }, | ||
743 | { STR(LANG_FILTER_PLAYLIST) }, | ||
744 | #ifdef HAVE_TAGCACHE | ||
745 | { STR(LANG_FILTER_ID3DB) } | ||
746 | #endif | ||
747 | }; | ||
748 | #ifdef HAVE_TAGCACHE | ||
749 | return set_option( str(LANG_FILTER), &global_settings.dirfilter, INT, | ||
750 | names, 5, NULL ); | ||
751 | #else | ||
752 | return set_option( str(LANG_FILTER), &global_settings.dirfilter, INT, | ||
753 | names, 4, NULL ); | ||
754 | #endif | ||
755 | } | ||
756 | |||
757 | static bool sort_case(void) | ||
758 | { | ||
759 | return set_bool( str(LANG_SORT_CASE), &global_settings.sort_case ); | ||
760 | } | ||
761 | |||
762 | static bool sort_file(void) | ||
763 | { | ||
764 | int oldval = global_settings.sort_file; | ||
765 | bool ret; | ||
766 | static const struct opt_items names[] = { | ||
767 | { STR(LANG_SORT_ALPHA) }, | ||
768 | { STR(LANG_SORT_DATE) }, | ||
769 | { STR(LANG_SORT_DATE_REVERSE) }, | ||
770 | { STR(LANG_SORT_TYPE) } | ||
771 | }; | ||
772 | ret = set_option( str(LANG_SORT_FILE), &global_settings.sort_file, INT, | ||
773 | names, 4, NULL ); | ||
774 | if (global_settings.sort_file != oldval) | ||
775 | reload_directory(); /* force reload if this has changed */ | ||
776 | return ret; | ||
777 | } | ||
778 | |||
779 | static bool sort_dir(void) | ||
780 | { | ||
781 | int oldval = global_settings.sort_dir; | ||
782 | bool ret; | ||
783 | static const struct opt_items names[] = { | ||
784 | { STR(LANG_SORT_ALPHA) }, | ||
785 | { STR(LANG_SORT_DATE) }, | ||
786 | { STR(LANG_SORT_DATE_REVERSE) } | ||
787 | }; | ||
788 | ret = set_option( str(LANG_SORT_DIR), &global_settings.sort_dir, INT, | ||
789 | names, 3, NULL ); | ||
790 | if (global_settings.sort_dir != oldval) | ||
791 | reload_directory(); /* force reload if this has changed */ | ||
792 | return ret; | ||
793 | } | ||
794 | |||
795 | static bool autocreatebookmark(void) | ||
796 | { | ||
797 | bool retval = false; | ||
798 | static const struct opt_items names[] = { | ||
799 | { STR(LANG_SET_BOOL_NO) }, | ||
800 | { STR(LANG_SET_BOOL_YES) }, | ||
801 | { STR(LANG_RESUME_SETTING_ASK) }, | ||
802 | { STR(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_YES) }, | ||
803 | { STR(LANG_BOOKMARK_SETTINGS_RECENT_ONLY_ASK) } | ||
804 | }; | ||
805 | |||
806 | retval = set_option( str(LANG_BOOKMARK_SETTINGS_AUTOCREATE), | ||
807 | &global_settings.autocreatebookmark, INT, | ||
808 | names, 5, NULL ); | ||
809 | if(global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_YES || | ||
810 | global_settings.autocreatebookmark == BOOKMARK_RECENT_ONLY_ASK) | ||
811 | { | ||
812 | if(global_settings.usemrb == BOOKMARK_NO) | ||
813 | global_settings.usemrb = BOOKMARK_YES; | ||
814 | |||
815 | } | ||
816 | return retval; | ||
817 | } | ||
818 | |||
819 | static bool autoloadbookmark(void) | ||
820 | { | ||
821 | static const struct opt_items names[] = { | ||
822 | { STR(LANG_SET_BOOL_NO) }, | ||
823 | { STR(LANG_SET_BOOL_YES) }, | ||
824 | { STR(LANG_RESUME_SETTING_ASK) } | ||
825 | }; | ||
826 | return set_option( str(LANG_BOOKMARK_SETTINGS_AUTOLOAD), | ||
827 | &global_settings.autoloadbookmark, INT, | ||
828 | names, 3, NULL ); | ||
829 | } | ||
830 | |||
831 | static bool useMRB(void) | ||
832 | { | ||
833 | static const struct opt_items names[] = { | ||
834 | { STR(LANG_SET_BOOL_NO) }, | ||
835 | { STR(LANG_SET_BOOL_YES) }, | ||
836 | { STR(LANG_BOOKMARK_SETTINGS_UNIQUE_ONLY) } | ||
837 | }; | ||
838 | return set_option( str(LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS), | ||
839 | &global_settings.usemrb, INT, | ||
840 | names, 3, NULL ); | ||
841 | } | ||
842 | |||
843 | static bool poweroff_idle_timer(void) | ||
844 | { | ||
845 | static const struct opt_items names[] = { | ||
846 | { STR(LANG_OFF) }, | ||
847 | { "1m ", TALK_ID(1, UNIT_MIN) }, | ||
848 | { "2m ", TALK_ID(2, UNIT_MIN) }, | ||
849 | { "3m ", TALK_ID(3, UNIT_MIN) }, | ||
850 | { "4m ", TALK_ID(4, UNIT_MIN) }, | ||
851 | { "5m ", TALK_ID(5, UNIT_MIN) }, | ||
852 | { "6m ", TALK_ID(6, UNIT_MIN) }, | ||
853 | { "7m ", TALK_ID(7, UNIT_MIN) }, | ||
854 | { "8m ", TALK_ID(8, UNIT_MIN) }, | ||
855 | { "9m ", TALK_ID(9, UNIT_MIN) }, | ||
856 | { "10m", TALK_ID(10, UNIT_MIN) }, | ||
857 | { "15m", TALK_ID(15, UNIT_MIN) }, | ||
858 | { "30m", TALK_ID(30, UNIT_MIN) }, | ||
859 | { "45m", TALK_ID(45, UNIT_MIN) }, | ||
860 | { "60m", TALK_ID(60, UNIT_MIN) } | ||
861 | }; | ||
862 | return set_option(str(LANG_POWEROFF_IDLE), &global_settings.poweroff, | ||
863 | INT, names, 15, set_poweroff_timeout); | ||
864 | } | ||
865 | |||
866 | static void sleep_timer_formatter(char* buffer, int buffer_size, int value, | ||
867 | const char* unit) | ||
868 | { | ||
869 | int minutes, hours; | ||
870 | |||
871 | (void) unit; | ||
872 | |||
873 | if (value) { | ||
874 | hours = value / 60; | ||
875 | minutes = value - (hours * 60); | ||
876 | snprintf(buffer, buffer_size, "%d:%02d", hours, minutes); | ||
877 | } else { | ||
878 | snprintf(buffer, buffer_size, "%s", str(LANG_OFF)); | ||
879 | } | ||
880 | } | ||
881 | |||
882 | static void sleep_timer_set(int minutes) | ||
883 | { | ||
884 | set_sleep_timer(minutes * 60); | ||
885 | } | ||
886 | |||
887 | static bool sleep_timer(void) | ||
888 | { | ||
889 | int minutes = (get_sleep_timer() + 59) / 60; /* round up */ | ||
890 | |||
891 | return set_int(str(LANG_SLEEP_TIMER), "", UNIT_MIN, &minutes, | ||
892 | &sleep_timer_set, 5, 0, 300, sleep_timer_formatter); | ||
893 | } | ||
894 | |||
895 | static bool scroll_speed(void) | 690 | static bool scroll_speed(void) |
896 | { | 691 | { |
897 | return set_int(str(LANG_SCROLL), "", UNIT_INT, | 692 | return set_int(str(LANG_SCROLL), "", UNIT_INT, |
@@ -1000,108 +795,6 @@ static bool jump_scroll_delay(void) | |||
1000 | } | 795 | } |
1001 | #endif | 796 | #endif |
1002 | 797 | ||
1003 | #ifndef SIMULATOR | ||
1004 | /** | ||
1005 | * Menu to set the battery capacity | ||
1006 | */ | ||
1007 | static bool battery_capacity(void) | ||
1008 | { | ||
1009 | return set_int(str(LANG_BATTERY_CAPACITY), "mAh", UNIT_MAH, | ||
1010 | &global_settings.battery_capacity, | ||
1011 | &set_battery_capacity, BATTERY_CAPACITY_INC, BATTERY_CAPACITY_MIN, | ||
1012 | BATTERY_CAPACITY_MAX, NULL ); | ||
1013 | } | ||
1014 | |||
1015 | #if BATTERY_TYPES_COUNT > 1 | ||
1016 | static bool battery_type(void) | ||
1017 | { | ||
1018 | static const struct opt_items names[] = { | ||
1019 | { STR(LANG_BATTERY_TYPE_ALKALINE) }, | ||
1020 | { STR(LANG_BATTERY_TYPE_NIMH) } | ||
1021 | }; | ||
1022 | |||
1023 | return set_option(str(LANG_BATTERY_TYPE), &global_settings.battery_type, | ||
1024 | INT, names, 2, set_battery_type); | ||
1025 | } | ||
1026 | #endif | ||
1027 | #endif | ||
1028 | |||
1029 | #ifdef CONFIG_RTC | ||
1030 | static bool timedate_set(void) | ||
1031 | { | ||
1032 | struct tm tm; | ||
1033 | bool result; | ||
1034 | |||
1035 | /* Make a local copy of the time struct */ | ||
1036 | memcpy(&tm, get_time(), sizeof(struct tm)); | ||
1037 | |||
1038 | /* do some range checks */ | ||
1039 | /* This prevents problems with time/date setting after a power loss */ | ||
1040 | if (!valid_time(&tm)) | ||
1041 | { | ||
1042 | /* hour */ | ||
1043 | tm.tm_hour = 0; | ||
1044 | tm.tm_min = 0; | ||
1045 | tm.tm_sec = 0; | ||
1046 | tm.tm_mday = 1; | ||
1047 | tm.tm_mon = 0; | ||
1048 | tm.tm_wday = 1; | ||
1049 | tm.tm_year = 100; | ||
1050 | } | ||
1051 | |||
1052 | result = set_time_screen(str(LANG_TIME), &tm); | ||
1053 | |||
1054 | if(tm.tm_year != -1) { | ||
1055 | set_time(&tm); | ||
1056 | } | ||
1057 | return result; | ||
1058 | } | ||
1059 | |||
1060 | static bool timeformat_set(void) | ||
1061 | { | ||
1062 | static const struct opt_items names[] = { | ||
1063 | { STR(LANG_24_HOUR_CLOCK) }, | ||
1064 | { STR(LANG_12_HOUR_CLOCK) } | ||
1065 | }; | ||
1066 | return set_option(str(LANG_TIMEFORMAT), &global_settings.timeformat, | ||
1067 | INT, names, 2, NULL); | ||
1068 | } | ||
1069 | #endif | ||
1070 | |||
1071 | #ifndef HAVE_MMC | ||
1072 | static bool spindown(void) | ||
1073 | { | ||
1074 | return set_int(str(LANG_SPINDOWN), "s", UNIT_SEC, | ||
1075 | &global_settings.disk_spindown, | ||
1076 | ata_spindown, 1, 3, 254, NULL ); | ||
1077 | } | ||
1078 | |||
1079 | #endif /* !HAVE_MMC */ | ||
1080 | |||
1081 | #if CONFIG_CODEC == MAS3507D | ||
1082 | static bool line_in(void) | ||
1083 | { | ||
1084 | bool rc = set_bool(str(LANG_LINE_IN), &global_settings.line_in); | ||
1085 | #ifndef SIMULATOR | ||
1086 | dac_line_in(global_settings.line_in); | ||
1087 | #endif | ||
1088 | return rc; | ||
1089 | } | ||
1090 | #endif | ||
1091 | |||
1092 | static bool max_files_in_dir(void) | ||
1093 | { | ||
1094 | return set_int(str(LANG_MAX_FILES_IN_DIR), "", UNIT_INT, | ||
1095 | &global_settings.max_files_in_dir, | ||
1096 | NULL, 50, 50, 10000, NULL ); | ||
1097 | } | ||
1098 | |||
1099 | static bool max_files_in_playlist(void) | ||
1100 | { | ||
1101 | return set_int(str(LANG_MAX_FILES_IN_PLAYLIST), "", UNIT_INT, | ||
1102 | &global_settings.max_files_in_playlist, | ||
1103 | NULL, 1000, 1000, 20000, NULL ); | ||
1104 | } | ||
1105 | 798 | ||
1106 | #ifdef CONFIG_BACKLIGHT | 799 | #ifdef CONFIG_BACKLIGHT |
1107 | static bool set_bl_filter_first_keypress(void) | 800 | static bool set_bl_filter_first_keypress(void) |
@@ -1122,11 +815,6 @@ static bool set_remote_bl_filter_first_keypress(void) | |||
1122 | #endif | 815 | #endif |
1123 | #endif | 816 | #endif |
1124 | 817 | ||
1125 | static bool browse_current(void) | ||
1126 | { | ||
1127 | return set_bool( str(LANG_FOLLOW), &global_settings.browse_current ); | ||
1128 | } | ||
1129 | |||
1130 | static bool custom_wps_browse(void) | 818 | static bool custom_wps_browse(void) |
1131 | { | 819 | { |
1132 | return rockbox_browse(WPS_DIR, SHOW_WPS); | 820 | return rockbox_browse(WPS_DIR, SHOW_WPS); |
@@ -1144,75 +832,6 @@ static bool custom_cfg_browse(void) | |||
1144 | return rockbox_browse(ROCKBOX_DIR, SHOW_CFG); | 832 | return rockbox_browse(ROCKBOX_DIR, SHOW_CFG); |
1145 | } | 833 | } |
1146 | 834 | ||
1147 | static bool language_browse(void) | ||
1148 | { | ||
1149 | return rockbox_browse(LANG_DIR, SHOW_LNG); | ||
1150 | } | ||
1151 | |||
1152 | static bool voice_menus(void) | ||
1153 | { | ||
1154 | bool ret; | ||
1155 | bool temp = global_settings.talk_menu; | ||
1156 | /* work on a temp variable first, avoid "life" disabling */ | ||
1157 | ret = set_bool( str(LANG_VOICE_MENU), &temp ); | ||
1158 | global_settings.talk_menu = temp; | ||
1159 | return ret; | ||
1160 | } | ||
1161 | |||
1162 | /* this is used 2 times below, so it saves memory to put it in global scope */ | ||
1163 | static const struct opt_items voice_names[] = { | ||
1164 | { STR(LANG_OFF) }, | ||
1165 | { STR(LANG_VOICE_NUMBER) }, | ||
1166 | { STR(LANG_VOICE_SPELL) }, | ||
1167 | { STR(LANG_VOICE_DIR_HOVER) } | ||
1168 | }; | ||
1169 | |||
1170 | static bool voice_dirs(void) | ||
1171 | { | ||
1172 | bool ret = set_option( str(LANG_VOICE_DIR), | ||
1173 | &global_settings.talk_dir, INT, voice_names, 4, NULL); | ||
1174 | #if CONFIG_CODEC == SWCODEC | ||
1175 | audio_set_crossfade(global_settings.crossfade); | ||
1176 | #endif | ||
1177 | return ret; | ||
1178 | } | ||
1179 | |||
1180 | static bool voice_files(void) | ||
1181 | { | ||
1182 | int oldval = global_settings.talk_file; | ||
1183 | bool ret; | ||
1184 | |||
1185 | ret = set_option( str(LANG_VOICE_FILE), | ||
1186 | &global_settings.talk_file, INT, voice_names, 4, NULL); | ||
1187 | #if CONFIG_CODEC == SWCODEC | ||
1188 | audio_set_crossfade(global_settings.crossfade); | ||
1189 | #endif | ||
1190 | if (oldval != 3 && global_settings.talk_file == 3) | ||
1191 | { /* force reload if newly talking thumbnails, | ||
1192 | because the clip presence is cached only if enabled */ | ||
1193 | reload_directory(); | ||
1194 | } | ||
1195 | return ret; | ||
1196 | } | ||
1197 | |||
1198 | static bool voice_menu(void) | ||
1199 | { | ||
1200 | int m; | ||
1201 | bool result; | ||
1202 | |||
1203 | static const struct menu_item items[] = { | ||
1204 | { ID2P(LANG_VOICE_MENU), voice_menus }, | ||
1205 | { ID2P(LANG_VOICE_DIR), voice_dirs }, | ||
1206 | { ID2P(LANG_VOICE_FILE), voice_files } | ||
1207 | }; | ||
1208 | |||
1209 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1210 | NULL, NULL, NULL); | ||
1211 | result = menu_run(m); | ||
1212 | menu_exit(m); | ||
1213 | return result; | ||
1214 | } | ||
1215 | |||
1216 | #ifdef HAVE_LCD_BITMAP | 835 | #ifdef HAVE_LCD_BITMAP |
1217 | static bool font_browse(void) | 836 | static bool font_browse(void) |
1218 | { | 837 | { |
@@ -1259,107 +878,6 @@ static bool codepage_setting(void) | |||
1259 | INT, names, 13, set_codepage ); | 878 | INT, names, 13, set_codepage ); |
1260 | } | 879 | } |
1261 | 880 | ||
1262 | #ifdef HAVE_DIRCACHE | ||
1263 | static bool dircache(void) | ||
1264 | { | ||
1265 | bool result = set_bool_options(str(LANG_DIRCACHE_ENABLE), | ||
1266 | &global_settings.dircache, | ||
1267 | STR(LANG_ON), | ||
1268 | STR(LANG_OFF), | ||
1269 | NULL); | ||
1270 | |||
1271 | if (!dircache_is_enabled() && global_settings.dircache) | ||
1272 | gui_syncsplash(HZ*2, true, str(LANG_PLEASE_REBOOT)); | ||
1273 | |||
1274 | if (!result) | ||
1275 | dircache_disable(); | ||
1276 | |||
1277 | return result; | ||
1278 | } | ||
1279 | #endif /* HAVE_DIRCACHE */ | ||
1280 | |||
1281 | #ifdef HAVE_TAGCACHE | ||
1282 | #ifdef HAVE_TC_RAMCACHE | ||
1283 | static bool tagcache_ram(void) | ||
1284 | { | ||
1285 | bool result = set_bool_options(str(LANG_TAGCACHE_RAM), | ||
1286 | &global_settings.tagcache_ram, | ||
1287 | STR(LANG_SET_BOOL_YES), | ||
1288 | STR(LANG_SET_BOOL_NO), | ||
1289 | NULL); | ||
1290 | |||
1291 | return result; | ||
1292 | } | ||
1293 | #endif | ||
1294 | |||
1295 | static bool tagcache_autoupdate(void) | ||
1296 | { | ||
1297 | bool rc = set_bool_options(str(LANG_TAGCACHE_AUTOUPDATE), | ||
1298 | &global_settings.tagcache_autoupdate, | ||
1299 | STR(LANG_ON), | ||
1300 | STR(LANG_OFF), | ||
1301 | NULL); | ||
1302 | return rc; | ||
1303 | } | ||
1304 | |||
1305 | static bool tagcache_runtimedb(void) | ||
1306 | { | ||
1307 | bool rc = set_bool_options(str(LANG_RUNTIMEDB_ACTIVE), | ||
1308 | &global_settings.runtimedb, | ||
1309 | STR(LANG_ON), | ||
1310 | STR(LANG_OFF), | ||
1311 | NULL); | ||
1312 | return rc; | ||
1313 | } | ||
1314 | |||
1315 | static bool tagcache_settings_menu(void) | ||
1316 | { | ||
1317 | int m; | ||
1318 | bool result; | ||
1319 | |||
1320 | static const struct menu_item items[] = { | ||
1321 | #ifdef HAVE_TC_RAMCACHE | ||
1322 | { ID2P(LANG_TAGCACHE_RAM), tagcache_ram }, | ||
1323 | #endif | ||
1324 | { ID2P(LANG_TAGCACHE_AUTOUPDATE), tagcache_autoupdate }, | ||
1325 | { ID2P(LANG_TAGCACHE_FORCE_UPDATE), tagcache_rebuild }, | ||
1326 | { ID2P(LANG_TAGCACHE_UPDATE), tagcache_update }, | ||
1327 | { ID2P(LANG_RUNTIMEDB_ACTIVE), tagcache_runtimedb }, | ||
1328 | { ID2P(LANG_TAGCACHE_EXPORT), tagtree_export }, | ||
1329 | { ID2P(LANG_TAGCACHE_IMPORT), tagtree_import }, | ||
1330 | }; | ||
1331 | |||
1332 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1333 | NULL, NULL, NULL); | ||
1334 | result = menu_run(m); | ||
1335 | menu_exit(m); | ||
1336 | return result; | ||
1337 | } | ||
1338 | #endif | ||
1339 | |||
1340 | bool playback_settings_menu(void) | ||
1341 | { | ||
1342 | return do_menu(&playback_menu_item); | ||
1343 | } | ||
1344 | |||
1345 | static bool bookmark_settings_menu(void) | ||
1346 | { | ||
1347 | int m; | ||
1348 | bool result; | ||
1349 | |||
1350 | static const struct menu_item items[] = { | ||
1351 | { ID2P(LANG_BOOKMARK_SETTINGS_AUTOCREATE), autocreatebookmark}, | ||
1352 | { ID2P(LANG_BOOKMARK_SETTINGS_AUTOLOAD), autoloadbookmark}, | ||
1353 | { ID2P(LANG_BOOKMARK_SETTINGS_MAINTAIN_RECENT_BOOKMARKS), useMRB}, | ||
1354 | }; | ||
1355 | |||
1356 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1357 | NULL, NULL, NULL); | ||
1358 | result = menu_run(m); | ||
1359 | menu_exit(m); | ||
1360 | |||
1361 | return result; | ||
1362 | } | ||
1363 | static bool reset_settings(void) | 881 | static bool reset_settings(void) |
1364 | { | 882 | { |
1365 | unsigned char *lines[]={str(LANG_RESET_ASK_RECORDER)}; | 883 | unsigned char *lines[]={str(LANG_RESET_ASK_RECORDER)}; |
@@ -1387,30 +905,6 @@ static bool reset_settings(void) | |||
1387 | return false; | 905 | return false; |
1388 | } | 906 | } |
1389 | 907 | ||
1390 | static bool fileview_settings_menu(void) | ||
1391 | { | ||
1392 | int m; | ||
1393 | bool result; | ||
1394 | |||
1395 | static const struct menu_item items[] = { | ||
1396 | { ID2P(LANG_SORT_CASE), sort_case }, | ||
1397 | { ID2P(LANG_SORT_DIR), sort_dir }, | ||
1398 | { ID2P(LANG_SORT_FILE), sort_file }, | ||
1399 | { ID2P(LANG_FILTER), dir_filter }, | ||
1400 | { ID2P(LANG_FOLLOW), browse_current }, | ||
1401 | { ID2P(LANG_SHOW_ICONS), show_icons }, | ||
1402 | { ID2P(LANG_SHOW_PATH), show_path }, | ||
1403 | #ifdef HAVE_TAGCACHE | ||
1404 | { ID2P(LANG_TAGCACHE), tagcache_settings_menu}, | ||
1405 | #endif | ||
1406 | }; | ||
1407 | |||
1408 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1409 | NULL, NULL, NULL); | ||
1410 | result = menu_run(m); | ||
1411 | menu_exit(m); | ||
1412 | return result; | ||
1413 | } | ||
1414 | 908 | ||
1415 | #ifdef HAVE_REMOTE_LCD | 909 | #ifdef HAVE_REMOTE_LCD |
1416 | static bool remote_scroll_sets(void) | 910 | static bool remote_scroll_sets(void) |
@@ -1611,75 +1105,6 @@ bool display_settings_menu(void) | |||
1611 | menu_exit(m); | 1105 | menu_exit(m); |
1612 | return result; | 1106 | return result; |
1613 | } | 1107 | } |
1614 | |||
1615 | |||
1616 | static bool battery_settings_menu(void) | ||
1617 | { | ||
1618 | int m; | ||
1619 | bool result; | ||
1620 | |||
1621 | static const struct menu_item items[] = { | ||
1622 | #ifndef SIMULATOR | ||
1623 | { ID2P(LANG_BATTERY_CAPACITY), battery_capacity }, | ||
1624 | #if BATTERY_TYPES_COUNT > 1 | ||
1625 | { ID2P(LANG_BATTERY_TYPE), battery_type }, | ||
1626 | #endif | ||
1627 | #ifdef HAVE_USB_POWER | ||
1628 | #ifdef CONFIG_CHARGING | ||
1629 | { ID2P(LANG_USB_CHARGING), usb_charging }, | ||
1630 | #endif | ||
1631 | #endif | ||
1632 | #else | ||
1633 | { "Dummy", NULL }, /* to have an entry at all, in the simulator */ | ||
1634 | #endif | ||
1635 | }; | ||
1636 | |||
1637 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1638 | NULL, NULL, NULL); | ||
1639 | result = menu_run(m); | ||
1640 | menu_exit(m); | ||
1641 | return result; | ||
1642 | } | ||
1643 | |||
1644 | #ifndef HAVE_MMC | ||
1645 | static bool disk_settings_menu(void) | ||
1646 | { | ||
1647 | int m; | ||
1648 | bool result; | ||
1649 | |||
1650 | static const struct menu_item items[] = { | ||
1651 | { ID2P(LANG_SPINDOWN), spindown }, | ||
1652 | #ifdef HAVE_DIRCACHE | ||
1653 | { ID2P(LANG_DIRCACHE_ENABLE), dircache }, | ||
1654 | #endif | ||
1655 | }; | ||
1656 | |||
1657 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1658 | NULL, NULL, NULL); | ||
1659 | result = menu_run(m); | ||
1660 | menu_exit(m); | ||
1661 | return result; | ||
1662 | } | ||
1663 | #endif /* !HAVE_MMC */ | ||
1664 | |||
1665 | #ifdef CONFIG_RTC | ||
1666 | static bool time_settings_menu(void) | ||
1667 | { | ||
1668 | int m; | ||
1669 | bool result; | ||
1670 | |||
1671 | static const struct menu_item items[] = { | ||
1672 | { ID2P(LANG_TIME), timedate_set }, | ||
1673 | { ID2P(LANG_TIMEFORMAT), timeformat_set }, | ||
1674 | }; | ||
1675 | |||
1676 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1677 | NULL, NULL, NULL); | ||
1678 | result = menu_run(m); | ||
1679 | menu_exit(m); | ||
1680 | return result; | ||
1681 | } | ||
1682 | #endif | ||
1683 | static bool manage_settings_write_config(void) | 1108 | static bool manage_settings_write_config(void) |
1684 | { | 1109 | { |
1685 | return settings_save_config(SETTINGS_SAVE_ALL); | 1110 | return settings_save_config(SETTINGS_SAVE_ALL); |
@@ -1708,76 +1133,3 @@ bool manage_settings_menu(void) | |||
1708 | return result; | 1133 | return result; |
1709 | } | 1134 | } |
1710 | 1135 | ||
1711 | static bool limits_settings_menu(void) | ||
1712 | { | ||
1713 | int m; | ||
1714 | bool result; | ||
1715 | |||
1716 | static const struct menu_item items[] = { | ||
1717 | { ID2P(LANG_MAX_FILES_IN_DIR), max_files_in_dir }, | ||
1718 | { ID2P(LANG_MAX_FILES_IN_PLAYLIST), max_files_in_playlist }, | ||
1719 | }; | ||
1720 | |||
1721 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1722 | NULL, NULL, NULL); | ||
1723 | result = menu_run(m); | ||
1724 | menu_exit(m); | ||
1725 | return result; | ||
1726 | } | ||
1727 | |||
1728 | |||
1729 | static bool system_settings_menu(void) | ||
1730 | { | ||
1731 | int m; | ||
1732 | bool result; | ||
1733 | |||
1734 | static const struct menu_item items[] = { | ||
1735 | { ID2P(LANG_BATTERY_MENU), battery_settings_menu }, | ||
1736 | #ifndef HAVE_MMC | ||
1737 | { ID2P(LANG_DISK_MENU), disk_settings_menu }, | ||
1738 | #endif | ||
1739 | #ifdef CONFIG_RTC | ||
1740 | { ID2P(LANG_TIME_MENU), time_settings_menu }, | ||
1741 | #endif | ||
1742 | { ID2P(LANG_POWEROFF_IDLE), poweroff_idle_timer }, | ||
1743 | { ID2P(LANG_SLEEP_TIMER), sleep_timer }, | ||
1744 | #ifdef HAVE_ALARM_MOD | ||
1745 | { ID2P(LANG_ALARM_MOD_ALARM_MENU), alarm_screen }, | ||
1746 | #endif | ||
1747 | { ID2P(LANG_LIMITS_MENU), limits_settings_menu }, | ||
1748 | #if CONFIG_CODEC == MAS3507D | ||
1749 | { ID2P(LANG_LINE_IN), line_in }, | ||
1750 | #endif | ||
1751 | #ifdef CONFIG_CHARGING | ||
1752 | { ID2P(LANG_CAR_ADAPTER_MODE), car_adapter_mode }, | ||
1753 | #endif | ||
1754 | }; | ||
1755 | |||
1756 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1757 | NULL, NULL, NULL); | ||
1758 | result = menu_run(m); | ||
1759 | menu_exit(m); | ||
1760 | return result; | ||
1761 | } | ||
1762 | |||
1763 | bool settings_menu(void) | ||
1764 | { | ||
1765 | int m; | ||
1766 | bool result; | ||
1767 | |||
1768 | static const struct menu_item items[] = { | ||
1769 | { ID2P(LANG_PLAYBACK), playback_settings_menu }, | ||
1770 | { ID2P(LANG_FILE), fileview_settings_menu }, | ||
1771 | { ID2P(LANG_DISPLAY), display_settings_menu }, | ||
1772 | { ID2P(LANG_SYSTEM), system_settings_menu }, | ||
1773 | { ID2P(LANG_BOOKMARK_SETTINGS),bookmark_settings_menu }, | ||
1774 | { ID2P(LANG_LANGUAGE), language_browse }, | ||
1775 | { ID2P(LANG_VOICE), voice_menu }, | ||
1776 | }; | ||
1777 | |||
1778 | m=menu_init( items, sizeof(items) / sizeof(*items), NULL, | ||
1779 | NULL, NULL, NULL); | ||
1780 | result = menu_run(m); | ||
1781 | menu_exit(m); | ||
1782 | return result; | ||
1783 | } | ||