Index: apps/plugins/disktidy.c =================================================================== --- apps/plugins/disktidy.c (revision 17994) +++ apps/plugins/disktidy.c (working copy) @@ -464,7 +464,7 @@ list.get_icon = get_icon; list.get_name = get_name; list.action_callback = list_action_callback; - rb->simplelist_show_list(&list); + rb->simplelist_show_list(&list, NULL); rb->global_settings->show_icons = show_icons; } break; Index: apps/gui/list.c =================================================================== --- apps/gui/list.c (revision 17994) +++ apps/gui/list.c (working copy) @@ -842,7 +842,8 @@ return simplelist_text[item]; } -bool simplelist_show_list(struct simplelist_info *info) +bool simplelist_show_list(struct simplelist_info *info, + struct viewport parent[NB_SCREENS]) { struct gui_synclist lists; struct viewport vp[NB_SCREENS]; @@ -854,7 +855,10 @@ getname = simplelist_static_getname; FOR_NB_SCREENS(i) { - viewport_set_defaults(&vp[i], i); + if (!parent) + viewport_set_defaults(&vp[i], i); + else + vp[i] = parent[i]; } gui_synclist_init(&lists, getname, info->callback_data, info->scroll_all, info->selection_size, vp); Index: apps/gui/list.h =================================================================== --- apps/gui/list.h (revision 17994) +++ apps/gui/list.h (working copy) @@ -252,6 +252,6 @@ /* show a list. if list->action_callback != NULL it is called with the action ACTION_REDRAW before the list is dislplayed for the first time */ -bool simplelist_show_list(struct simplelist_info *info); +bool simplelist_show_list(struct simplelist_info *info, struct viewport parent[NB_SCREENS]); #endif /* _GUI_LIST_H_ */ Index: apps/menus/time_menu.c =================================================================== --- apps/menus/time_menu.c (revision 0) +++ apps/menus/time_menu.c (revision 0) @@ -0,0 +1,363 @@ +/*************************************************************************** + * __________ __ ___. + * Open \______ \ ____ ____ | | _\_ |__ _______ ___ + * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / + * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < + * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ + * \/ \/ \/ \/ \/ + * $Id: main_menu.c 17985 2008-07-08 02:30:58Z jdgordon $ + * + * Copyright (C) 2007 Jonathan Gordon + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY + * KIND, either express or implied. + * + ****************************************************************************/ + +#include +#include +#include +#include "config.h" +#include "string.h" +#include "sprintf.h" +#include "lang.h" +#include "action.h" +#include "settings.h" +#include "powermgmt.h" +#include "menu.h" +#include "misc.h" +#include "exported_menus.h" +#include "yesno.h" +#include "keyboard.h" +#include "talk.h" +#include "splash.h" +#include "version.h" +#include "time.h" +#include "viewport.h" +#include "list.h" +#include "alarm_menu.h" +#include "screens.h" + +static int timedate_set(void) +{ + struct tm tm; + int result; + + /* Make a local copy of the time struct */ + memcpy(&tm, get_time(), sizeof(struct tm)); + + /* do some range checks */ + /* This prevents problems with time/date setting after a power loss */ + if (!valid_time(&tm)) + { +/* Macros to convert a 2-digit string to a decimal constant. + (YEAR), MONTH and DAY are set by the date command, which outputs + DAY as 00..31 and MONTH as 01..12. The leading zero would lead to + misinterpretation as an octal constant. */ +#define S100(x) 1 ## x +#define C2DIG2DEC(x) (S100(x)-100) + + tm.tm_hour = 0; + tm.tm_min = 0; + tm.tm_sec = 0; + tm.tm_mday = C2DIG2DEC(DAY); + tm.tm_mon = C2DIG2DEC(MONTH)-1; + tm.tm_wday = 1; + tm.tm_year = YEAR-1900; + } + + result = (int)set_time_screen(str(LANG_SET_TIME), &tm); + + if(tm.tm_year != -1) { + set_time(&tm); + } + return result; +} + +MENUITEM_FUNCTION(time_set, 0, ID2P(LANG_SET_TIME), + timedate_set, NULL, NULL, Icon_NOICON); +MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL); + +int sleep_timer(void); + + +#ifdef HAVE_RTC_ALARM +MENUITEM_FUNCTION(alarm_screen_call, 0, ID2P(LANG_ALARM_MOD_ALARM_MENU), + (menu_function)alarm_screen, NULL, NULL, Icon_NOICON); +#if CONFIG_TUNER || defined(HAVE_RECORDING) + +#if CONFIG_TUNER && !defined(HAVE_RECORDING) +/* This need only be shown if we dont have recording, because if we do + then always show the setting item, because there will always be at least + 2 items */ +static int alarm_callback(int action,const struct menu_item_ex *this_item) +{ + (void)this_item; + switch (action) + { + case ACTION_REQUEST_MENUITEM: + if (radio_hardware_present() == 0) + return ACTION_EXIT_MENUITEM; + break; + } + return action; +} +#else +#define alarm_callback NULL +#endif /* CONFIG_TUNER && !HAVE_RECORDING */ +/* have to do this manually because the setting screen + doesnt handle variable item count */ +static int alarm_setting(void) +{ + struct opt_items items[ALARM_START_COUNT]; + int i = 0; + items[i].string = str(LANG_RESUME_PLAYBACK); + items[i].voice_id = LANG_RESUME_PLAYBACK; + i++; +#if CONFIG_TUNER + if (radio_hardware_present()) + { + items[i].string = str(LANG_FM_RADIO); + items[i].voice_id = LANG_FM_RADIO; + i++; + } +#endif +#ifdef HAVE_RECORDING + items[i].string = str(LANG_RECORDING); + items[i].voice_id = LANG_RECORDING; + i++; +#endif + return set_option(str(LANG_ALARM_WAKEUP_SCREEN), + &global_settings.alarm_wake_up_screen, + INT, items, i, NULL); +} + +MENUITEM_FUNCTION(alarm_wake_up_screen, 0, ID2P(LANG_ALARM_WAKEUP_SCREEN), + alarm_setting, NULL, alarm_callback, Icon_Menu_setting); +#endif /* CONFIG_TUNER || defined(HAVE_RECORDING) */ +MAKE_MENU(alarm_menu, ID2P(LANG_ALARM_MOD_ALARM_MENU), + 0, Icon_System_menu, +#ifdef HAVE_RTC_ALARM + &alarm_screen_call, +#if defined(HAVE_RECORDING) || CONFIG_TUNER + &alarm_wake_up_screen, +#endif +#endif + + ); +#endif /* HAVE_RTC_ALARM */ +static void talk_timedate(void) +{ + struct tm *tm = get_time(); + if (!global_settings.talk_menu) + return; + talk_id(VOICE_CURRENT_TIME, false); + if (valid_time(tm)) + { + talk_time(tm, true); + talk_date(get_time(), true); + } + else + { + talk_id(LANG_UNKNOWN, true); + } +} + +static void draw_timedate(struct viewport *vp, struct screen *display) +{ + struct tm *tm = get_time(); + int w, line; + char time[16], date[16]; + display->set_viewport(vp); + display->clear_viewport(); + if (viewport_get_nb_lines(vp) > 3) + line = 1; + else + line = 0; + + if (valid_time(tm)) + { + snprintf(time, 16, "%02d:%02d:%02d %s", + global_settings.timeformat == 0 ? tm->tm_hour : + ((tm->tm_hour + 11) % 12) + 1, + tm->tm_min, + tm->tm_sec, + global_settings.timeformat == 0 ? "" : + tm->tm_hour>11 ? "P" : "A"); + snprintf(date, 16, "%s %d %d", + str(LANG_MONTH_JANUARY + tm->tm_mon), + tm->tm_mday, + tm->tm_year+1900); + } + else + { + snprintf(time, 16, "%s", "--:--:--"); + snprintf(date, 16, "%s", str(LANG_UNKNOWN)); + } + display->getstringsize(time, &w, NULL); + if (w > vp->width) + display->puts_scroll(0, line, time); + else + display->putsxy((vp->width - w)/2, line*font_get(vp->font)->height, time); + line++; + + display->getstringsize(date, &w, NULL); + if (w > vp->width) + display->puts_scroll(0, line, date); + else + display->putsxy((vp->width - w)/2, line*font_get(vp->font)->height, date); + display->update_viewport(); +} + + +enum { + CHANGE_DATETIME = 0, +#ifdef HAVE_RTC_ALARM + CHANGE_ALARM, +#endif + SLEEP_TIMER, + TIME_FORMAT, + TIMESCREEN_ITEM_COUNT +}; + +struct viewport clock[NB_SCREENS], menu[NB_SCREENS]; +int return_value = GO_TO_ROOT; + +static int time_menu_speak_item(int selected_item, void * data) +{ + (void)data; + switch (selected_item) + { + case CHANGE_DATETIME: + return talk_id(LANG_SET_TIME, true); +#ifdef HAVE_RTC_ALARM + case CHANGE_ALARM: + return talk_id(LANG_ALARM_MOD_ALARM_MENU, false); +#endif + case SLEEP_TIMER: + return talk_id(LANG_SLEEP_TIMER, false); + case TIME_FORMAT: + return talk_id(LANG_TIMEFORMAT, false); + } + return 0; +} + +static int time_menu_action_callback(int btn, struct gui_synclist *lists) +{ + int selection = gui_synclist_get_sel_pos(lists); + int i; + switch (btn) + { + case ACTION_STD_OK: + switch (selection) + { + case CHANGE_DATETIME: + timedate_set(); + break; +#ifdef HAVE_RTC_ALARM + case CHANGE_ALARM: + do_menu(&alarm_menu, NULL, NULL, false); + break; +#endif + case SLEEP_TIMER: + sleep_timer(); + break; + case TIME_FORMAT: + do_setting_from_menu(&timeformat, NULL); + break; + } + FOR_NB_SCREENS(i) + draw_timedate(&clock[i], &screens[i]); + return ACTION_REDRAW; + break; + case ACTION_STD_CONTEXT: + talk_timedate(); + break; + case ACTION_NONE: + case ACTION_REDRAW: + FOR_NB_SCREENS(i) + draw_timedate(&clock[i], &screens[i]); + break; +#if 0 + case ACTION_STD_WPS: + return_value = GO_TO_PREVIOUS_MUSIC; + return ACTION_STD_CANCEL; +#endif + } + return btn; +} + + +static char* time_menu_getname(int item, void * data, + char *buffer, size_t buffer_len) +{ + (void)data; (void)buffer; (void)buffer_len; + switch (item) + { + case CHANGE_DATETIME: + return str(LANG_SET_TIME); +#ifdef HAVE_RTC_ALARM + case CHANGE_ALARM: + return str(LANG_ALARM_MOD_ALARM_MENU); +#endif + case SLEEP_TIMER: + return str(LANG_SLEEP_TIMER); + case TIME_FORMAT: + return str(LANG_TIMEFORMAT); + } + return ""; +} +int time_screen(void* ignored) +{ + (void)ignored; + int i, nb_lines, font_h; + struct simplelist_info info; + FOR_NB_SCREENS(i) + { + viewport_set_defaults(&clock[i], i); + nb_lines = viewport_get_nb_lines(&clock[i]); + menu[i] = clock[i]; + font_h = font_get(clock[i].font)->height; + if (nb_lines >= 5) + { + clock[i].height = 3*font_h; + if (nb_lines > 5) + clock[i].height += font_h; + } + else if (nb_lines >= 3) + { + clock[i].height = 2*font_h; + } + else + { + clock[i].height = font_h; + } + menu[i].y = clock[i].y + clock[i].height; + menu[i].height = screens[i].lcdheight - menu[i].y; + screens[i].clear_display(); + screens[i].update(); + } + simplelist_info_init(&info, str(LANG_TIME_MENU), + TIMESCREEN_ITEM_COUNT, NULL); + info.action_callback = time_menu_action_callback; + info.get_name = time_menu_getname; + if (global_settings.talk_menu) + info.get_talk = time_menu_speak_item; + info.timeout = HZ/2; + return_value = GO_TO_ROOT; + //talk_timedate(); + simplelist_show_list(&info, menu); + return return_value; +} + + + + + + + Index: apps/menus/settings_menu.c =================================================================== --- apps/menus/settings_menu.c (revision 17994) +++ apps/menus/settings_menu.c (working copy) @@ -211,109 +211,9 @@ ); #endif -/* Time & Date */ -#if CONFIG_RTC -static int timedate_set(void) -{ - struct tm tm; - int result; - - /* Make a local copy of the time struct */ - memcpy(&tm, get_time(), sizeof(struct tm)); - - /* do some range checks */ - /* This prevents problems with time/date setting after a power loss */ - if (!valid_time(&tm)) - { -/* Macros to convert a 2-digit string to a decimal constant. - (YEAR), MONTH and DAY are set by the date command, which outputs - DAY as 00..31 and MONTH as 01..12. The leading zero would lead to - misinterpretation as an octal constant. */ -#define S100(x) 1 ## x -#define C2DIG2DEC(x) (S100(x)-100) - - tm.tm_hour = 0; - tm.tm_min = 0; - tm.tm_sec = 0; - tm.tm_mday = C2DIG2DEC(DAY); - tm.tm_mon = C2DIG2DEC(MONTH)-1; - tm.tm_wday = 1; - tm.tm_year = YEAR-1900; - } - - result = (int)set_time_screen(str(LANG_SET_TIME), &tm); - - if(tm.tm_year != -1) { - set_time(&tm); - } - return result; -} - -MENUITEM_FUNCTION(time_set, 0, ID2P(LANG_SET_TIME), - timedate_set, NULL, NULL, Icon_NOICON); -MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL); -MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), 0, Icon_NOICON, &time_set, &timeformat); -#endif - /* System menu */ MENUITEM_SETTING(poweroff, &global_settings.poweroff, NULL); -#ifdef HAVE_RTC_ALARM -MENUITEM_FUNCTION(alarm_screen_call, 0, ID2P(LANG_ALARM_MOD_ALARM_MENU), - (menu_function)alarm_screen, NULL, NULL, Icon_NOICON); -#if CONFIG_TUNER || defined(HAVE_RECORDING) - -#if CONFIG_TUNER && !defined(HAVE_RECORDING) -/* This need only be shown if we dont have recording, because if we do - then always show the setting item, because there will always be at least - 2 items */ -static int alarm_callback(int action,const struct menu_item_ex *this_item) -{ - (void)this_item; - switch (action) - { - case ACTION_REQUEST_MENUITEM: - if (radio_hardware_present() == 0) - return ACTION_EXIT_MENUITEM; - break; - } - return action; -} -#else -#define alarm_callback NULL -#endif /* CONFIG_TUNER && !HAVE_RECORDING */ -/* have to do this manually because the setting screen - doesnt handle variable item count */ -static int alarm_setting(void) -{ - struct opt_items items[ALARM_START_COUNT]; - int i = 0; - items[i].string = str(LANG_RESUME_PLAYBACK); - items[i].voice_id = LANG_RESUME_PLAYBACK; - i++; -#if CONFIG_TUNER - if (radio_hardware_present()) - { - items[i].string = str(LANG_FM_RADIO); - items[i].voice_id = LANG_FM_RADIO; - i++; - } -#endif -#ifdef HAVE_RECORDING - items[i].string = str(LANG_RECORDING); - items[i].voice_id = LANG_RECORDING; - i++; -#endif - return set_option(str(LANG_ALARM_WAKEUP_SCREEN), - &global_settings.alarm_wake_up_screen, - INT, items, i, NULL); -} - -MENUITEM_FUNCTION(alarm_wake_up_screen, 0, ID2P(LANG_ALARM_WAKEUP_SCREEN), - alarm_setting, NULL, alarm_callback, Icon_Menu_setting); -#endif /* CONFIG_TUNER || defined(HAVE_RECORDING) */ -#endif /* HAVE_RTC_ALARM */ - /* Limits menu */ MENUITEM_SETTING(max_files_in_dir, &global_settings.max_files_in_dir, NULL); MENUITEM_SETTING(max_files_in_playlist, &global_settings.max_files_in_playlist, NULL); @@ -377,16 +277,7 @@ #if defined(HAVE_DIRCACHE) || !defined(HAVE_FLASH_STORAGE) &disk_menu, #endif -#if CONFIG_RTC - &time_menu, -#endif &poweroff, -#ifdef HAVE_RTC_ALARM - &alarm_screen_call, -#if defined(HAVE_RECORDING) || CONFIG_TUNER - &alarm_wake_up_screen, -#endif -#endif &limits_menu, #if CONFIG_CODEC == MAS3507D &line_in, Index: apps/menus/main_menu.c =================================================================== --- apps/menus/main_menu.c (revision 17994) +++ apps/menus/main_menu.c (working copy) @@ -143,10 +143,6 @@ INFO_DISK2, /* free space or external capacity/free on hotswap */ INFO_BUFFER, INFO_VERSION, -#if CONFIG_RTC - INFO_DATE, - INFO_TIME, -#endif INFO_COUNT }; @@ -161,9 +157,6 @@ char *buffer, size_t buffer_len) { struct info_data *info = (struct info_data*)data; -#if CONFIG_RTC - struct tm *tm; -#endif char s1[32]; #ifdef HAVE_MULTIVOLUME char s2[32]; @@ -185,39 +178,6 @@ snprintf(buffer, buffer_len, "%s: %s", str(LANG_VERSION), appsversion); break; -#if CONFIG_RTC - case INFO_TIME: - tm = get_time(); - if (valid_time(tm)) - { - snprintf(buffer, buffer_len, "%02d:%02d:%02d %s", - global_settings.timeformat == 0 ? tm->tm_hour : - ((tm->tm_hour + 11) % 12) + 1, - tm->tm_min, - tm->tm_sec, - global_settings.timeformat == 0 ? "" : - tm->tm_hour>11 ? "P" : "A"); - } - else - { - snprintf(buffer, buffer_len, "%s", "--:--:--"); - } - break; - case INFO_DATE: - tm = get_time(); - if (valid_time(tm)) - { - snprintf(buffer, buffer_len, "%s %d %d", - str(LANG_MONTH_JANUARY + tm->tm_mon), - tm->tm_mday, - tm->tm_year+1900); - } - else - { - snprintf(buffer, buffer_len, "%s", str(LANG_UNKNOWN)); - } - break; -#endif case INFO_BUFFER: /* buffer */ { long buflen = ((audiobufend - audiobuf) * 2) / 2097; /* avoid overflow */ @@ -289,46 +249,12 @@ { struct info_data *info = (struct info_data*)data; -#if CONFIG_RTC - struct tm *tm; - static int last_talk = 0; -#endif - switch (selected_item) { case INFO_VERSION: /* version */ talk_id(LANG_VERSION, false); talk_spell(appsversion, true); break; -#if CONFIG_RTC - case INFO_TIME: - if (TIME_AFTER(current_tick, last_talk + HZ*60)) - { - tm = get_time(); - talk_id(VOICE_CURRENT_TIME, false); - if (valid_time(tm)) - { - talk_time(tm, true); - } - else - { - talk_id(LANG_UNKNOWN, true); - } - last_talk = current_tick; - } - break; - case INFO_DATE: - tm = get_time(); - if (valid_time(tm)) - { - talk_date(get_time(), true); - } - else - { - talk_id(LANG_UNKNOWN, true); - } - break; -#endif case INFO_BUFFER: /* buffer */ { talk_id(LANG_BUFFER_STAT, false); @@ -421,22 +347,6 @@ #endif return ACTION_REDRAW; } -#if CONFIG_RTC - else if (action == ACTION_NONE) - { - if ((global_settings.talk_menu && lists->selected_item == INFO_TIME) || - (!global_settings.talk_menu && - gui_synclist_item_is_onscreen(lists, 0, INFO_TIME))) - { - static int last_redraw = 0; - if (TIME_AFTER(current_tick, last_redraw + HZ*5)) - { - last_redraw = current_tick; - return ACTION_REDRAW; - } - } - } -#endif return action; } static bool show_info(void) @@ -451,12 +361,11 @@ if(global_settings.talk_menu) info.get_talk = info_speak_item; info.action_callback = info_action_callback; - return simplelist_show_list(&info); + return simplelist_show_list(&info, NULL); } MENUITEM_FUNCTION(show_info_item, 0, ID2P(LANG_ROCKBOX_INFO), (menu_function)show_info, NULL, NULL, Icon_NOICON); - /* sleep Menu */ static void sleep_timer_formatter(char* buffer, size_t buffer_size, int value, const char* unit) @@ -479,16 +388,19 @@ set_sleep_timer(minutes * 60); } -static int sleep_timer(void) +int sleep_timer(void) { int minutes = (get_sleep_timer() + 59) / 60; /* round up */ return (int)set_int(str(LANG_SLEEP_TIMER), "", UNIT_MIN, &minutes, &sleep_timer_set, -5, 300, 0, sleep_timer_formatter); } +#if CONFIG_RTC == 0 +/* This item is in the time/date screen if there is a RTC */ MENUITEM_FUNCTION(sleep_timer_call, 0, ID2P(LANG_SLEEP_TIMER), sleep_timer, NULL, NULL, Icon_Menu_setting); /* make it look like a setting to the user */ +#endif MENUITEM_FUNCTION(show_credits_item, 0, ID2P(LANG_VERSION), (menu_function)show_credits, NULL, NULL, Icon_NOICON); MENUITEM_FUNCTION(show_runtime_item, 0, ID2P(LANG_RUNNING_TIME), @@ -498,7 +410,10 @@ MAKE_MENU(info_menu, ID2P(LANG_SYSTEM), 0, Icon_Questionmark, &show_info_item, &show_credits_item, &show_runtime_item, - &sleep_timer_call, &debug_menu_item); +#if CONFIG_RTC == 0 + &sleep_timer_call, +#endif + &debug_menu_item); /* INFO MENU */ /***********************************/ Index: apps/SOURCES =================================================================== --- apps/SOURCES (revision 17994) +++ apps/SOURCES (working copy) @@ -26,6 +26,9 @@ #endif menus/settings_menu.c menus/sound_menu.c +#if CONFIG_RTC +menus/time_menu.c +#endif misc.c onplay.c playlist.c Index: apps/plugin.h =================================================================== --- apps/plugin.h (revision 17994) +++ apps/plugin.h (working copy) @@ -325,7 +325,7 @@ void (*gui_synclist_set_title)(struct gui_synclist *lists, char* title, int icon); void (*simplelist_info_init)(struct simplelist_info *info, char* title, int count, void* data); - bool (*simplelist_show_list)(struct simplelist_info *info); + bool (*simplelist_show_list)(struct simplelist_info *info, struct viewport parent[NB_SCREENS]); /* button */ long (*button_get)(bool block); Index: apps/filetypes.c =================================================================== --- apps/filetypes.c (revision 17994) +++ apps/filetypes.c (working copy) @@ -493,7 +493,7 @@ info.action_callback = openwith_action_callback; info.get_name = openwith_get_name; info.get_icon = openwith_get_icon; - return simplelist_show_list(&info); + return simplelist_show_list(&info, NULL); } int filetype_load_plugin(const char* plugin, char* file) Index: apps/root_menu.c =================================================================== --- apps/root_menu.c (revision 17994) +++ apps/root_menu.c (working copy) @@ -310,6 +310,7 @@ } return retval; } +int time_screen(void* ignored); /* These are all static const'd from apps/menus/ *.c so little hack so we can use them */ @@ -341,6 +342,9 @@ [GO_TO_RECENTBMARKS] = { load_bmarks, NULL, &bookmark_settings_menu }, [GO_TO_BROWSEPLUGINS] = { plugins_menu, NULL, NULL }, +#if CONFIG_RTC + [GO_TO_TIMESCREEN] = { time_screen, NULL, NULL }, +#endif }; static const int nb_items = sizeof(items)/sizeof(*items); @@ -377,6 +381,10 @@ MENUITEM_RETURNVALUE(bookmarks, ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS), GO_TO_RECENTBMARKS, item_callback, Icon_Bookmark); +#if CONFIG_RTC +MENUITEM_RETURNVALUE(timedate_item, ID2P(LANG_TIME_MENU), + GO_TO_TIMESCREEN, NULL, Icon_Menu_setting ); +#endif #ifdef HAVE_LCD_CHARCELLS static int do_shutdown(void) { @@ -409,6 +417,9 @@ #ifdef HAVE_LCD_CHARCELLS ,&do_shutdown_item #endif +#if CONFIG_RTC + ,&timedate_item +#endif ); int item_callback(int action, const struct menu_item_ex *this_item) Index: apps/debug_menu.c =================================================================== --- apps/debug_menu.c (revision 17994) +++ apps/debug_menu.c (working copy) @@ -217,7 +217,7 @@ #endif info.action_callback = dbg_threads_action_callback; info.get_name = threads_getname; - return simplelist_show_list(&info); + return simplelist_show_list(&info, NULL); } #ifdef HAVE_LCD_BITMAP @@ -798,7 +798,7 @@ info.hide_selection = true; info.scroll_all = true; info.get_name = dbg_partitions_getname; - return simplelist_show_list(&info); + return simplelist_show_list(&info, NULL); } #endif @@ -1528,7 +1528,7 @@ info.timeout = HZ/100; info.get_name = tsc2100_debug_getname; info.action_callback= tsc2100debug_action_callback; - return simplelist_show_list(&info); + return simplelist_show_list(&info, NULL); } #endif #ifndef SIMULATOR @@ -1977,7 +1977,7 @@ info.action_callback = disk_callback; info.hide_selection = true; info.scroll_all = true; - return simplelist_show_list(&info); + return simplelist_show_list(&info, NULL); } #endif /* !SIMULATOR */ @@ -2010,7 +2010,7 @@ info.action_callback = dircache_callback; info.hide_selection = true; info.scroll_all = true; - return simplelist_show_list(&info); + return simplelist_show_list(&info, NULL); } #endif /* HAVE_DIRCACHE */ @@ -2074,7 +2074,7 @@ /* info.timeout = TIMEOUT_NOBLOCK; */ info.timeout = 1; tagcache_screensync_enable(true); - return simplelist_show_list(&info); + return simplelist_show_list(&info, NULL); } #endif @@ -2222,7 +2222,7 @@ info.action_callback = radio_hardware_present()?radio_callback : NULL; info.hide_selection = true; - return simplelist_show_list(&info); + return simplelist_show_list(&info, NULL); } #endif /* CONFIG_TUNER */ #endif /* !SIMULATOR */ @@ -2432,7 +2432,7 @@ isp1583.hide_selection = true; isp1583.get_name = dbg_usb_item; isp1583.action_callback = isp1583_action_callback; - return simplelist_show_list(&isp1583); + return simplelist_show_list(&isp1583, NULL); } #endif @@ -2457,7 +2457,7 @@ pic.hide_selection = true; pic.get_name = pic_dbg_item; pic.action_callback = pic_action_callback; - return simplelist_show_list(&pic); + return simplelist_show_list(&pic, NULL); } #endif @@ -2580,5 +2580,5 @@ info.action_callback = menu_action_callback; info.get_name = dbg_menu_getname; - return simplelist_show_list(&info); + return simplelist_show_list(&info, NULL); } Index: apps/root_menu.h =================================================================== --- apps/root_menu.h (revision 17994) +++ apps/root_menu.h (working copy) @@ -49,6 +49,7 @@ be the "start screen" after a boot up. The setting in settings_list.c will need editing if this is the case. */ GO_TO_BROWSEPLUGINS, + GO_TO_TIMESCREEN, }; extern const struct menu_item_ex root_menu_;