From daa8341a13ddc93981d2c2178b183a13b5e08950 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Sun, 4 May 2008 10:58:05 +0000 Subject: a bit of code cleanup.. use a single function to get the statusbar height (or lack of if its enabled), and remove some gui_textarea stuff which could be done using the splash. (gui_textarea is on the way out) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17350 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 56 +++++--------------------------------------------------- 1 file changed, 5 insertions(+), 51 deletions(-) (limited to 'apps/tree.c') diff --git a/apps/tree.c b/apps/tree.c index afe76a3dc8..a5741dfc31 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -936,8 +936,6 @@ static bool add_dir(char* dirname, int len, int fd) for (i=0; i < filetypes_count; i++) { if (filetypes[i].tree_attr == FILE_ATTR_AUDIO) { if (!strcasecmp(cp, filetypes[i].extension)) { - char buf[8]; - int i; write(fd, dirname, strlen(dirname)); write(fd, "/", 1); write(fd, entry->d_name, x); @@ -946,28 +944,8 @@ static bool add_dir(char* dirname, int len, int fd) plsize++; if(TIME_AFTER(current_tick, pltick+HZ/4)) { pltick = current_tick; - - snprintf(buf, sizeof buf, "%d", plsize); -#ifdef HAVE_LCD_BITMAP - FOR_NB_SCREENS(i) - { - screens[i].puts(0, 4, (unsigned char *)buf); - gui_textarea_update(&screens[i]); - } -#else - if (plsize > 999) - x=7; - else if (plsize > 99) - x=8; - else if (plsize > 9) - x=9; - else - x = 10; - - FOR_NB_SCREENS(i) { - screens[i].puts(x,0,buf); - } -#endif + gui_syncsplash(0, "%d %s", + plsize, str(LANG_DIR_BROWSER)); } break; } @@ -984,22 +962,14 @@ static bool add_dir(char* dirname, int len, int fd) bool create_playlist(void) { int fd; - int i; char filename[MAX_PATH]; pltick = current_tick; snprintf(filename, sizeof filename, "%s.m3u8", tc.currdir[1] ? tc.currdir : "/root"); - FOR_NB_SCREENS(i) - { - gui_textarea_clear(&screens[i]); - screens[i].puts(0, 0, str(LANG_CREATING)); - screens[i].puts_scroll(0, 1, (unsigned char *)filename); -#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR) - gui_textarea_update(&screens[i]); -#endif - } + gui_syncsplash(0, "%s %s", str(LANG_CREATING), filename); + fd = creat(filename); if (fd < 0) return false; @@ -1272,25 +1242,9 @@ void tree_restore(void) if (global_settings.dircache) { /* Print "Scanning disk..." to the display. */ - int i; - FOR_NB_SCREENS(i) - { - screens[i].putsxy((LCD_WIDTH/2) - - ((strlen(str(LANG_SCANNING_DISK)) * - screens[i].char_width)/2), - LCD_HEIGHT-screens[i].char_height*3, - str(LANG_SCANNING_DISK)); - gui_textarea_update(&screens[i]); - } - cond_talk_ids_fq(LANG_SCANNING_DISK); + gui_syncsplash(0, str(LANG_SCANNING_DISK)); dircache_build(global_status.dircache_size); - - /* Clean the text when we are done. */ - FOR_NB_SCREENS(i) - { - gui_textarea_clear(&screens[i]); - } } #endif #ifdef HAVE_TAGCACHE -- cgit v1.2.3