diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2004-01-21 14:58:40 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2004-01-21 14:58:40 +0000 |
commit | ef7293f0bc336beb30f3a5f2eafad4a447f60ac5 (patch) | |
tree | 68b02b0278b25a10a261d8813bbf5be39e1a51b6 /apps/tree.c | |
parent | 33acdef9db5ffa2c6f93dc07d0400c7a72a0f25e (diff) | |
download | rockbox-ef7293f0bc336beb30f3a5f2eafad4a447f60ac5.tar.gz rockbox-ef7293f0bc336beb30f3a5f2eafad4a447f60ac5.zip |
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
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 27 |
1 files changed, 27 insertions, 0 deletions
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, | |||
772 | { | 772 | { |
773 | int onplay_result; | 773 | int onplay_result; |
774 | 774 | ||
775 | if(!numentries) | ||
776 | break; | ||
777 | |||
775 | if (currdir[1]) | 778 | if (currdir[1]) |
776 | snprintf(buf, sizeof buf, "%s/%s", | 779 | snprintf(buf, sizeof buf, "%s/%s", |
777 | currdir, dircache[dircursor+dirstart].name); | 780 | currdir, dircache[dircursor+dirstart].name); |
@@ -1499,6 +1502,30 @@ bool create_playlist(void) | |||
1499 | return true; | 1502 | return true; |
1500 | } | 1503 | } |
1501 | 1504 | ||
1505 | bool create_dir(void) | ||
1506 | { | ||
1507 | char dirname[MAX_PATH]; | ||
1508 | int rc; | ||
1509 | int pathlen; | ||
1510 | |||
1511 | memset(dirname, 0, sizeof dirname); | ||
1512 | |||
1513 | snprintf(dirname, sizeof dirname, "%s/", | ||
1514 | currdir[1] ? currdir : ""); | ||
1515 | |||
1516 | pathlen = strlen(dirname); | ||
1517 | rc = kbd_input(dirname + pathlen, (sizeof dirname)-pathlen); | ||
1518 | if(rc < 0) | ||
1519 | return false; | ||
1520 | |||
1521 | rc = mkdir(dirname, 0); | ||
1522 | if(rc < 0) { | ||
1523 | splash(HZ, true, "%s %s", str(LANG_CREATE_DIR), str(LANG_FAILED)); | ||
1524 | } | ||
1525 | |||
1526 | return true; | ||
1527 | } | ||
1528 | |||
1502 | bool rockbox_browse(char *root, int dirfilter) | 1529 | bool rockbox_browse(char *root, int dirfilter) |
1503 | { | 1530 | { |
1504 | bool rc; | 1531 | bool rc; |