aboutsummaryrefslogtreecommitdiffstats
path: root/screen_help.c
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-03-26 12:31:40 +0000
committerKalle Wallin <kaw@linux.se>2004-03-26 12:31:40 +0000
commitde0277cb4f648484179ddca68a39cadcdb892338 (patch)
tree1684dbcfc8c0d7c1de1dc5ffbdb9a983c1511caf /screen_help.c
parent8ccbb1a4fc500d7ae746868da85907f4c80f1ea2 (diff)
downloadmpd-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 'screen_help.c')
-rw-r--r--screen_help.c61
1 files changed, 23 insertions, 38 deletions
diff --git a/screen_help.c b/screen_help.c
index 5320647be..34a007c0a 100644
--- a/screen_help.c
+++ b/screen_help.c
@@ -32,7 +32,10 @@ static help_text_row_t help_text[] =
{ 0, CMD_LIST_NEXT, "Move cursor up" },
{ 0, CMD_LIST_PREVIOUS, "Move cursor down" },
{ 0, CMD_LIST_FIND, "Find" },
- { 0, CMD_LIST_FIND_NEXT, "Find again" },
+ { 0, CMD_LIST_RFIND, "find backward" },
+ { 0, CMD_LIST_FIND_NEXT, "Find next" },
+ { 0, CMD_LIST_RFIND_NEXT,"Find previuos" },
+ { 0, CMD_TOGGLE_FIND_WRAP, "Toggle find mode" },
{ 0, CMD_NONE, " " },
{ 0, CMD_SCREEN_NEXT, "Change screen" },
{ 0, CMD_SCREEN_HELP, "Help screen" },
@@ -43,18 +46,20 @@ static help_text_row_t help_text[] =
{ 0, CMD_NONE, " " },
{ 1, CMD_NONE, " Keys - Playlist screen " },
{ 0, CMD_NONE, " --------------------------" },
- { 0, CMD_PLAY, "Play selected entry" },
- { 0, CMD_DELETE, "Delete selected entry from platlist" },
- { 0, CMD_SHUFFLE, "Shuffle playlist" },
- { 0, CMD_CLEAR, "Clear playlist" },
- { 0, CMD_REPEAT, "Toggle repeat mode" },
- { 0, CMD_RANDOM, "Toggle random mode" },
+ { 0, CMD_PLAY, "Play selected entry" },
+ { 0, CMD_DELETE, "Delete selected entry from playlist" },
+ { 0, CMD_SHUFFLE, "Shuffle playlist" },
+ { 0, CMD_CLEAR, "Clear playlist" },
+ { 0, CMD_SAVE_PLAYLIST, "Save playlist" },
+ { 0, CMD_REPEAT, "Toggle repeat mode" },
+ { 0, CMD_RANDOM, "Toggle random mode" },
{ 0, CMD_NONE, " " },
{ 0, CMD_NONE, " " },
{ 1, CMD_NONE, " Keys - Browse screen " },
{ 0, CMD_NONE, " ------------------------" },
- { 0, CMD_PLAY, "Change to selected directory" },
- { 0, CMD_SELECT, "Add/Remove selected file" },
+ { 0, CMD_PLAY, "Enter directory/Load playlist" },
+ { 0, CMD_SELECT, "Add/remove song from playlist" },
+ { 0, CMD_DELETE_PLAYLIST, "Delete playlist" },
{ 0, CMD_NONE, " " },
{ 0, CMD_NONE, " " },
{ 1, CMD_NONE, " " PACKAGE " version " VERSION },
@@ -131,33 +136,13 @@ help_update(screen_t *screen, mpd_client_t *c)
int
help_cmd(screen_t *screen, mpd_client_t *c, command_t cmd)
{
- switch(cmd)
- {
- case CMD_LIST_FIND:
- if( screen->findbuf )
- {
- free(screen->findbuf);
- screen->findbuf=NULL;
- }
- /* continue... */
- case CMD_LIST_FIND_NEXT:
- if( !screen->findbuf )
- screen->findbuf=screen_readln(screen->status_window.w, "/");
- if( list_window_find(screen->helplist,
- list_callback,
- c,
- screen->findbuf) == 0 )
- {
- screen->helplist->repaint = 1;
- }
- else
- {
- screen_status_printf("Unable to find \'%s\'", screen->findbuf);
- beep();
- }
- return 1;
- default:
- break;
- }
- return list_window_cmd(screen->helplist, help_text_rows, cmd);
+ int retval;
+
+ retval = list_window_cmd(screen->helplist, help_text_rows, cmd);
+ if( !retval )
+ return screen_find(screen, c,
+ screen->helplist, help_text_rows,
+ cmd, list_callback);
+
+ return retval;
}