diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2008-07-05 12:31:04 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2008-07-05 12:31:04 +0000 |
commit | 311d048f6f265f8a2d5dcd4050c0da32bfa05f68 (patch) | |
tree | 76324f83fd5d07d8dde7ca2e3106e6d10d64375c /apps/menus | |
parent | 2a75a9045c478fc55dad013d74de8c2f144d3046 (diff) | |
download | rockbox-311d048f6f265f8a2d5dcd4050c0da32bfa05f68.tar.gz rockbox-311d048f6f265f8a2d5dcd4050c0da32bfa05f68.zip |
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
Diffstat (limited to 'apps/menus')
-rw-r--r-- | apps/menus/main_menu.c | 34 |
1 files changed, 22 insertions, 12 deletions
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) | |||
291 | 291 | ||
292 | #if CONFIG_RTC | 292 | #if CONFIG_RTC |
293 | struct tm *tm; | 293 | struct tm *tm; |
294 | static int last_talk = 0; | ||
294 | #endif | 295 | #endif |
295 | 296 | ||
296 | switch (selected_item) | 297 | switch (selected_item) |
@@ -313,14 +314,18 @@ static int info_speak_item(int selected_item, void * data) | |||
313 | } | 314 | } |
314 | break; | 315 | break; |
315 | case INFO_DATE: | 316 | case INFO_DATE: |
316 | tm = get_time(); | 317 | if (TIME_AFTER(current_tick, last_talk + HZ*60)) |
317 | if (valid_time(tm)) | ||
318 | { | ||
319 | talk_date(get_time(), true); | ||
320 | } | ||
321 | else | ||
322 | { | 318 | { |
323 | talk_id(LANG_UNKNOWN, true); | 319 | tm = get_time(); |
320 | if (valid_time(tm)) | ||
321 | { | ||
322 | talk_date(get_time(), true); | ||
323 | } | ||
324 | else | ||
325 | { | ||
326 | talk_id(LANG_UNKNOWN, true); | ||
327 | } | ||
328 | last_talk = current_tick; | ||
324 | } | 329 | } |
325 | break; | 330 | break; |
326 | #endif | 331 | #endif |
@@ -417,13 +422,18 @@ static int info_action_callback(int action, struct gui_synclist *lists) | |||
417 | return ACTION_REDRAW; | 422 | return ACTION_REDRAW; |
418 | } | 423 | } |
419 | #if CONFIG_RTC | 424 | #if CONFIG_RTC |
420 | else if (action == ACTION_NONE && lists->selected_item == INFO_TIME) | 425 | else if (action == ACTION_NONE) |
421 | { | 426 | { |
422 | static int last_redraw = 0; | 427 | if ((global_settings.talk_menu && lists->selected_item == INFO_TIME) || |
423 | if (TIME_AFTER(current_tick, last_redraw + HZ/2)) | 428 | (!global_settings.talk_menu && |
429 | gui_synclist_item_is_onscreen(lists, 0, INFO_TIME))) | ||
424 | { | 430 | { |
425 | last_redraw = current_tick; | 431 | static int last_redraw = 0; |
426 | return ACTION_REDRAW; | 432 | if (TIME_AFTER(current_tick, last_redraw + HZ*5)) |
433 | { | ||
434 | last_redraw = current_tick; | ||
435 | return ACTION_REDRAW; | ||
436 | } | ||
427 | } | 437 | } |
428 | } | 438 | } |
429 | #endif | 439 | #endif |