Index: apps/sleeptimer.c =================================================================== RCS file: /cvsroot/rockbox/apps/sleeptimer.c,v retrieving revision 1.15 diff -u -r1.15 sleeptimer.c --- apps/sleeptimer.c 5 Dec 2005 22:44:41 -0000 1.15 +++ apps/sleeptimer.c 18 Dec 2005 13:58:16 -0000 @@ -19,7 +19,6 @@ #include "config.h" #include "options.h" -#include "lcd.h" #include "font.h" #include "button.h" #include "kernel.h" @@ -32,7 +31,7 @@ #include "debug.h" #include "talk.h" #include "icons.h" - +#include "screen_access.h" #include "lang.h" #define SMALL_STEP_SIZE 15*60 /* Seconds */ @@ -52,17 +51,21 @@ int org_timer=get_sleep_timer(); bool changed=false; bool sayit = true; - + + int i; + FOR_NB_SCREENS(i) + { #ifdef HAVE_LCD_BITMAP - if (global_settings.statusbar) - lcd_setmargins(0, STATUSBAR_HEIGHT); - else - lcd_setmargins(0, 0); + if (global_settings.statusbar) + screens[i].setmargins(0, STATUSBAR_HEIGHT); + else + screens[i].setmargins(0, 0); + #endif - lcd_clear_display(); - lcd_puts_scroll(0, 0, str(LANG_SLEEP_TIMER)); - + screens[i].clear_display(); + screens[i].puts_scroll(0, 0, str(LANG_SLEEP_TIMER)); + } while(!done) { button = button_get_w_tmo(HZ); @@ -71,15 +74,30 @@ #ifdef SETTINGS_OK2 case SETTINGS_OK2: #endif +#ifdef SELECT_RC_OK + case SELECT_RC_OK : +#endif +#ifdef SELECT_RC_OK2 + case SELECT_RC_OK2 : +#endif case SETTINGS_OK: done = true; break; +#ifdef SELECT_RC_CANCEL + case SELECT_RC_CANCEL : +#endif +#ifdef SELECT_RC_CANCEL2 + case SELECT_RC_CANCEL2 : +#endif case SETTINGS_CANCEL: if (changed) { - lcd_stop_scroll(); - lcd_puts(0, 0, str(LANG_MENU_SETTING_CANCEL)); - lcd_update(); + FOR_NB_SCREENS(i) + { + screens[i].stop_scroll(); + screens[i].puts(0, 0, str(LANG_MENU_SETTING_CANCEL)); + screens[i].update(); + } set_sleep_timer(org_timer); sleep(HZ/2); } @@ -87,6 +105,9 @@ break; case SETTINGS_INC: +#ifdef SELECT_RC_INC + case SELECT_RC_INC : +#endif oldtime = (get_sleep_timer()+59) / 60; if(oldtime < THRESHOLD) amount = SMALL_STEP_SIZE; @@ -102,6 +123,9 @@ break; case SETTINGS_DEC: +#ifdef SELECT_RC_DEC + case SELECT_RC_DEC : +#endif oldtime = (get_sleep_timer()+59) / 60; if(oldtime <= THRESHOLD) amount = SMALL_STEP_SIZE; @@ -126,7 +150,8 @@ minutes = (seconds - (hours * 3600)) / 60; snprintf(buf, 32, "%d:%02d", hours, minutes); - lcd_puts(0, 1, (unsigned char *)buf); + FOR_NB_SCREENS(i) + screens[i].puts(0, 1, (unsigned char *)buf); if (sayit && global_settings.talk_menu) { @@ -147,7 +172,8 @@ } else { - lcd_puts(0, 1, str(LANG_OFF)); + FOR_NB_SCREENS(i) + screens[i].puts(0, 1, str(LANG_OFF)); if (sayit && global_settings.talk_menu) { talk_id(LANG_OFF, false); @@ -157,8 +183,10 @@ gui_syncstatusbar_draw(&statusbars, true); - lcd_update(); + FOR_NB_SCREENS(i) + screens[i].update(); } - lcd_stop_scroll(); + FOR_NB_SCREENS(i) + screens[i].stop_scroll(); return false; }