From 95b5a376967fa1767e6503b2bc1b9594d6c910e9 Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Sat, 27 Mar 2004 16:52:36 +0000 Subject: [PATCH] Added update command. git-svn-id: https://svn.musicpd.org/ncmpc/trunk@513 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- command.c | 2 ++ command.h | 1 + screen_file.c | 6 +++++- screen_help.c | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/command.c b/command.c index d254c4e..d2d1e68 100644 --- a/command.c +++ b/command.c @@ -72,12 +72,14 @@ static command_definition_t cmds[] = { { '?', 0, 0 }, CMD_LIST_RFIND, "Backward Find" }, { { 'p', 0, 0 }, CMD_LIST_RFIND_NEXT, "Backward Find Previous" }, + { { TAB, 0, 0 }, CMD_SCREEN_NEXT, "Next screen" }, { { STAB, 0, 0 }, CMD_SCREEN_PREVIOUS, "Previous screen" }, { { F1, '1', 'h' }, CMD_SCREEN_HELP, "Help screen" }, { { F2, '2', 0 }, CMD_SCREEN_PLAY, "Playlist screen" }, { { F3, '3', 0 }, CMD_SCREEN_FILE, "Browse screen" }, // { { F4, '4', 0 }, CMD_SCREEN_SEARCH, "Search screen" }, + { {'u', 0, 0 }, CMD_SCREEN_UPDATE, "Update screen" }, { { 'q', 0, 0 }, CMD_QUIT, "Quit " PACKAGE }, diff --git a/command.h b/command.h index 485b753..a7e0855 100644 --- a/command.h +++ b/command.h @@ -27,6 +27,7 @@ typedef enum CMD_LIST_FIND_NEXT, CMD_LIST_RFIND, CMD_LIST_RFIND_NEXT, + CMD_SCREEN_UPDATE, CMD_SCREEN_PREVIOUS, CMD_SCREEN_NEXT, CMD_SCREEN_PLAY, diff --git a/screen_file.c b/screen_file.c index 762752e..19230e0 100644 --- a/screen_file.c +++ b/screen_file.c @@ -396,8 +396,12 @@ file_cmd(screen_t *screen, mpd_client_t *c, command_t cmd) break; case CMD_DELETE: handle_delete(screen, c); - return 1; break; + case CMD_SCREEN_UPDATE: + mpc_update_filelist(c); + list_window_check_selected(screen->filelist, c->filelist_length); + screen_status_printf("Screen updated!"); + return 1; case CMD_LIST_FIND: case CMD_LIST_RFIND: case CMD_LIST_FIND_NEXT: diff --git a/screen_help.c b/screen_help.c index de5bfe3..09349a3 100644 --- a/screen_help.c +++ b/screen_help.c @@ -60,6 +60,7 @@ static help_text_row_t help_text[] = { 0, CMD_PLAY, "Enter directory/Load playlist" }, { 0, CMD_SELECT, "Add/remove song from playlist" }, { 0, CMD_DELETE, "Delete playlist" }, + { 0, CMD_SCREEN_UPDATE, "Update" }, { 0, CMD_NONE, " " }, { 0, CMD_NONE, " " }, { 1, CMD_NONE, " " PACKAGE " version " VERSION }, -- 2.30.2