diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2006-12-27 02:37:12 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2006-12-27 02:37:12 +0000 |
| commit | 5f23fe0277f75690554018561bf3c16d7fb211f2 (patch) | |
| tree | 6ccb1c53649292e2b80d73793381492967f34a7f | |
| parent | 594099f1735e4ca92a9cc10d8375e728a72256f1 (diff) | |
| download | rockbox-5f23fe0277f75690554018561bf3c16d7fb211f2.zip rockbox-5f23fe0277f75690554018561bf3c16d7fb211f2.tar.gz rockbox-5f23fe0277f75690554018561bf3c16d7fb211f2.tar.bz2 rockbox-5f23fe0277f75690554018561bf3c16d7fb211f2.tar.xz | |
Minor changes to the delete screen (FS#6022). Use multi-screen api.
Show the file bin deleted instead of just the current folder. Makes it
look less like it has frozen.
Boost the cpu for the delete folder call.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11846 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/onplay.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index 98b1270..5e7d1e0 100644 --- a/apps/onplay.c +++ b/apps/onplay.c @@ -410,6 +410,7 @@ static int remove_dir(char* dirname, int len) int result = 0; DIR* dir; int dirlen = strlen(dirname); + int i; dir = opendir(dirname); if (!dir) @@ -423,9 +424,12 @@ static int remove_dir(char* dirname, int len) if (!entry) break; + dirname[dirlen] ='\0'; + FOR_NB_SCREENS(i) + screens[i].puts(0,1,dirname); + /* append name to current directory */ snprintf(dirname+dirlen, len-dirlen, "/%s", entry->d_name); - if (entry->attribute & ATTR_DIRECTORY) { /* remove a subdirectory */ if (!strcmp((char *)entry->d_name, ".") || @@ -433,18 +437,21 @@ static int remove_dir(char* dirname, int len) continue; /* skip these */ /* inform the user which dir we're deleting */ - lcd_puts(0,1,dirname); -#ifdef HAVE_LCD_BITMAP - lcd_update(); -#endif + result = remove_dir(dirname, len); /* recursion */ if (result) break; /* or better continue, delete what we can? */ } else { /* remove a file */ + FOR_NB_SCREENS(i) + screens[i].puts_scroll(0,2,entry->d_name); result = remove(dirname); } +#ifdef HAVE_LCD_BITMAP + FOR_NB_SCREENS(i) + screens[i].update(); +#endif if(ACTION_STD_CANCEL == get_action(CONTEXT_STD,TIMEOUT_NOBLOCK)) { gui_syncsplash(HZ, true, str(LANG_MENU_SETTING_CANCEL)); @@ -485,8 +492,10 @@ static bool delete_handler(bool is_dir) if (is_dir) { char pathname[MAX_PATH]; /* space to go deep */ + cpu_boost(true); strncpy(pathname, selected_file, sizeof pathname); res = remove_dir(pathname, sizeof(pathname)); + cpu_boost(false); } else res = remove(selected_file); |