All pastes #646227 Raw Edit

Unnamed

public text v1 · immutable
#646227 ·published 2007-08-05 09:59 UTC
rendered paste body
Index: apps/onplay.c
===================================================================
--- apps/onplay.c	(revision 14178)
+++ apps/onplay.c	(working copy)
@@ -487,8 +487,13 @@
         }
         else
         {   /* remove a file */
+#ifdef HAVE_LCD_BITMAP
             FOR_NB_SCREENS(i)
-                screens[i].puts_scroll(0,2,entry->d_name);
+            {
+                show_busy_slider(&screens[i], 2, 3*screens[i].char_height,
+                                 LCD_WIDTH-4, screens[i].char_height);
+            }
+#endif
             result = remove(dirname);
         }
 #ifdef HAVE_LCD_BITMAP
@@ -669,7 +674,9 @@
     ssize_t size, bytesread, byteswritten;
     char *buffer;
     bool result = false;
-
+#ifdef HAVE_LCD_BITMAP
+    int i;
+#endif
     if (copy) {
         /* See if we can get the plugin buffer for the file copy buffer */
         buffer = (char *) plugin_get_buffer(&buffersize);
@@ -708,9 +715,15 @@
                         result = false;
                         break;
                     }
-
                     size -= bytesread;
-
+#ifdef HAVE_LCD_BITMAP
+                    FOR_NB_SCREENS(i)
+                    {
+                        show_busy_slider(&screens[i], 2, screens[i].char_height,
+                                            LCD_WIDTH-4, screens[i].char_height);
+                        screens[i].update();
+                    }
+#endif
                     while(bytesread > 0) {
                         byteswritten = write(target_fd, buffer, bytesread);
 
Index: apps/gui/scrollbar.c
===================================================================
--- apps/gui/scrollbar.c	(revision 14178)
+++ apps/gui/scrollbar.c	(working copy)
@@ -241,4 +241,36 @@
 #endif
     }
 }
+
+void show_busy_slider(struct screen *s, int x, int y, int width, int height)
+{
+    static int start = 0, dir = 1;
+    gui_scrollbar_draw(s, x, y, width, height, 100,
+                           start, start+20, HORIZONTAL);
+#if NB_SCREENS > 1
+    if (s->screen_type == SCREEN_MAIN)
+    {
+#endif
+        if (dir == 1)
+        {
+            start += 2;
+            if (start+20 > 99)
+            {
+                dir = -1;
+                start = 80;
+            }
+        }
+        else
+        {
+            start -= 2;
+            if (start < 1)
+            {
+                dir = 1;
+            }
+        }
+#if NB_SCREENS > 1
+    }
+#endif
+}
+
 #endif /* HAVE_LCD_BITMAP */
Index: apps/gui/scrollbar.h
===================================================================
--- apps/gui/scrollbar.h	(revision 14178)
+++ apps/gui/scrollbar.h	(working copy)
@@ -55,5 +55,6 @@
                             int width, int height, int items,
                             int min_shown, int max_shown,
                             unsigned flags);
+extern void show_busy_slider(struct screen *s, int x, int y, int width, int height);
 #endif /* HAVE_LCD_BITMAP */
 #endif /* _GUI_SCROLLBAR_H_ */