From 311d048f6f265f8a2d5dcd4050c0da32bfa05f68 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Sat, 5 Jul 2008 12:31:04 +0000 Subject: fix FS#9144 hopefully for good... only update the screen if the time line is selected, or if talking menus are disabled, only update if the time line is actually on the screen. Also only update every 5s so scrolling lines still scroll. (turns out scroll_all was broken! fixed now) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17944 a1c6a512-1295-4272-9138-f99709370657 --- apps/menus/main_menu.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'apps/menus/main_menu.c') diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 985efc2580..614f5a6c34 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c @@ -291,6 +291,7 @@ static int info_speak_item(int selected_item, void * data) #if CONFIG_RTC struct tm *tm; + static int last_talk = 0; #endif switch (selected_item) @@ -313,14 +314,18 @@ static int info_speak_item(int selected_item, void * data) } break; case INFO_DATE: - tm = get_time(); - if (valid_time(tm)) - { - talk_date(get_time(), true); - } - else + if (TIME_AFTER(current_tick, last_talk + HZ*60)) { - talk_id(LANG_UNKNOWN, true); + tm = get_time(); + if (valid_time(tm)) + { + talk_date(get_time(), true); + } + else + { + talk_id(LANG_UNKNOWN, true); + } + last_talk = current_tick; } break; #endif @@ -417,13 +422,18 @@ static int info_action_callback(int action, struct gui_synclist *lists) return ACTION_REDRAW; } #if CONFIG_RTC - else if (action == ACTION_NONE && lists->selected_item == INFO_TIME) + else if (action == ACTION_NONE) { - static int last_redraw = 0; - if (TIME_AFTER(current_tick, last_redraw + HZ/2)) + if ((global_settings.talk_menu && lists->selected_item == INFO_TIME) || + (!global_settings.talk_menu && + gui_synclist_item_is_onscreen(lists, 0, INFO_TIME))) { - last_redraw = current_tick; - return ACTION_REDRAW; + static int last_redraw = 0; + if (TIME_AFTER(current_tick, last_redraw + HZ*5)) + { + last_redraw = current_tick; + return ACTION_REDRAW; + } } } #endif -- cgit v1.2.3