diff options
author | Kalle Wallin <kaw@linux.se> | 2004-03-26 12:31:40 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2004-03-26 12:31:40 +0000 |
commit | de0277cb4f648484179ddca68a39cadcdb892338 (patch) | |
tree | 1684dbcfc8c0d7c1de1dc5ffbdb9a983c1511caf /screen_file.c | |
parent | 8ccbb1a4fc500d7ae746868da85907f4c80f1ea2 (diff) | |
download | mpd-de0277cb4f648484179ddca68a39cadcdb892338.tar.gz mpd-de0277cb4f648484179ddca68a39cadcdb892338.tar.xz mpd-de0277cb4f648484179ddca68a39cadcdb892338.zip |
Added reversed and wrapped list search (find).
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@497 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | screen_file.c | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/screen_file.c b/screen_file.c index 9d2dffbc8..e3de2d051 100644 --- a/screen_file.c +++ b/screen_file.c @@ -31,7 +31,7 @@ list_callback(int index, int *highlight, void *data) if( entity == NULL ) { - return "[Back]"; + return "[..]"; } if( entity->type==MPD_INFO_ENTITY_TYPE_DIRECTORY ) { @@ -52,7 +52,7 @@ list_callback(int index, int *highlight, void *data) mpd_PlaylistFile *plf = entity->info.playlistFile; char *filename = utf8_to_locale(basename(plf->path)); - snprintf(buf, BUFSIZE, "%s*", filename); + snprintf(buf, BUFSIZE, "*%s*", filename); free(filename); return buf; } @@ -342,29 +342,17 @@ file_cmd(screen_t *screen, mpd_client_t *c, command_t cmd) cmd = CMD_LIST_NEXT; } break; + case CMD_DELETE_PLAYLIST: + screen_status_printf("Sorry, command not implemented yet!"); + return 1; + break; case CMD_LIST_FIND: - if( screen->findbuf ) - { - free(screen->findbuf); - screen->findbuf=NULL; - } - /* continue... */ + case CMD_LIST_RFIND: case CMD_LIST_FIND_NEXT: - if( !screen->findbuf ) - screen->findbuf=screen_readln(screen->status_window.w, "/"); - if( list_window_find(screen->filelist, - list_callback, - c, - screen->findbuf) == 0 ) - { - screen->filelist->repaint = 1; - } - else - { - screen_status_printf("Unable to find \'%s\'", screen->findbuf); - beep(); - } - return 1; + case CMD_LIST_RFIND_NEXT: + return screen_find(screen, c, + screen->filelist, c->filelist_length, + cmd, list_callback); default: break; } |