diff options
Diffstat (limited to 'apps/menus/settings_menu.c')
-rw-r--r-- | apps/menus/settings_menu.c | 53 |
1 files changed, 50 insertions, 3 deletions
diff --git a/apps/menus/settings_menu.c b/apps/menus/settings_menu.c index b962f1fb52..03a6054ff6 100644 --- a/apps/menus/settings_menu.c +++ b/apps/menus/settings_menu.c | |||
@@ -211,11 +211,58 @@ MENUITEM_SETTING(poweroff, &global_settings.poweroff, NULL); | |||
211 | #ifdef HAVE_RTC_ALARM | 211 | #ifdef HAVE_RTC_ALARM |
212 | MENUITEM_FUNCTION(alarm_screen_call, ID2P(LANG_ALARM_MOD_ALARM_MENU), | 212 | MENUITEM_FUNCTION(alarm_screen_call, ID2P(LANG_ALARM_MOD_ALARM_MENU), |
213 | (menu_function)alarm_screen, NULL, Icon_NOICON); | 213 | (menu_function)alarm_screen, NULL, Icon_NOICON); |
214 | #if defined(HAVE_RECORDING) || CONFIG_TUNER | 214 | #if CONFIG_TUNER || defined(HAVE_RECORDING) |
215 | MENUITEM_SETTING(alarm_wake_up_screen, | 215 | |
216 | &global_settings.alarm_wake_up_screen, NULL); | 216 | #if CONFIG_TUNER && !defined(HAVE_RECORDING) |
217 | /* This need only be shown if we dont have recording, because if we do | ||
218 | then always show the setting item, because there will always be at least | ||
219 | 2 items */ | ||
220 | static int alarm_callback(int action,const struct menu_item_ex *this_item) | ||
221 | { | ||
222 | (void)this_item; | ||
223 | switch (action) | ||
224 | { | ||
225 | case ACTION_REQUEST_MENUITEM: | ||
226 | if (radio_hardware_present() == 0) | ||
227 | return ACTION_EXIT_MENUITEM; | ||
228 | break; | ||
229 | } | ||
230 | return action; | ||
231 | } | ||
232 | #else | ||
233 | #define alarm_callback NULL | ||
234 | #endif /* CONFIG_TUNER && !HAVE_RECORDING */ | ||
235 | /* have to do this manually because the setting screen | ||
236 | doesnt handle variable item count */ | ||
237 | static int alarm_setting(void) | ||
238 | { | ||
239 | struct opt_items items[ALARM_START_COUNT]; | ||
240 | int i = 0; | ||
241 | items[i].string = str(LANG_RESUME_PLAYBACK); | ||
242 | items[i].voice_id = LANG_RESUME_PLAYBACK; | ||
243 | i++; | ||
244 | #if CONFIG_TUNER | ||
245 | if (radio_hardware_present()) | ||
246 | { | ||
247 | items[i].string = str(LANG_FM_RADIO); | ||
248 | items[i].voice_id = LANG_FM_RADIO; | ||
249 | i++; | ||
250 | } | ||
217 | #endif | 251 | #endif |
252 | #ifdef HAVE_RECORDING | ||
253 | items[i].string = str(LANG_RECORDING); | ||
254 | items[i].voice_id = LANG_RECORDING; | ||
255 | i++; | ||
218 | #endif | 256 | #endif |
257 | return set_option(str(LANG_ALARM_WAKEUP_SCREEN), | ||
258 | &global_settings.alarm_wake_up_screen, | ||
259 | INT, items, i, NULL); | ||
260 | } | ||
261 | |||
262 | MENUITEM_FUNCTION(alarm_wake_up_screen, ID2P(LANG_ALARM_WAKEUP_SCREEN), | ||
263 | alarm_setting, alarm_callback, Icon_Menu_setting); | ||
264 | #endif /* CONFIG_TUNER || defined(HAVE_RECORDING) */ | ||
265 | #endif /* HAVE_RTC_ALARM */ | ||
219 | 266 | ||
220 | /* Limits menu */ | 267 | /* Limits menu */ |
221 | MENUITEM_SETTING(max_files_in_dir, &global_settings.max_files_in_dir, NULL); | 268 | MENUITEM_SETTING(max_files_in_dir, &global_settings.max_files_in_dir, NULL); |