From ef7293f0bc336beb30f3a5f2eafad4a447f60ac5 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Wed, 21 Jan 2004 14:58:40 +0000 Subject: New feature: NOw you can store the recorded files in either /recordings (the directory will be created automatically) or in the current directory. New feature: A "Create directory" menu option (untested in the simulator). Bug fix: The ON+Play menu could do nasty things if you pressed ON+Play in an empty dir. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4268 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'apps/tree.c') diff --git a/apps/tree.c b/apps/tree.c index 9e1a22f567..aedeeb1dfd 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -772,6 +772,9 @@ static bool handle_on(int *ds, int *dc, int numentries, int tree_max_on_screen, { int onplay_result; + if(!numentries) + break; + if (currdir[1]) snprintf(buf, sizeof buf, "%s/%s", currdir, dircache[dircursor+dirstart].name); @@ -1499,6 +1502,30 @@ bool create_playlist(void) return true; } +bool create_dir(void) +{ + char dirname[MAX_PATH]; + int rc; + int pathlen; + + memset(dirname, 0, sizeof dirname); + + snprintf(dirname, sizeof dirname, "%s/", + currdir[1] ? currdir : ""); + + pathlen = strlen(dirname); + rc = kbd_input(dirname + pathlen, (sizeof dirname)-pathlen); + if(rc < 0) + return false; + + rc = mkdir(dirname, 0); + if(rc < 0) { + splash(HZ, true, "%s %s", str(LANG_CREATE_DIR), str(LANG_FAILED)); + } + + return true; +} + bool rockbox_browse(char *root, int dirfilter) { bool rc; -- cgit v1.2.3