diff options
author | Max Kellermann <max@duempel.org> | 2008-10-02 15:20:18 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-10-02 15:20:18 +0200 |
commit | a277ac660bdf2871ebbcddcb5288e29a03a46c92 (patch) | |
tree | ff30dfe7758c8b79263a2415a75a55c4f8aa6202 /src/screen_search.c | |
parent | bedf936a8d54bab5e51d5fadb3b42440ec864f61 (diff) | |
download | mpd-a277ac660bdf2871ebbcddcb5288e29a03a46c92.tar.gz mpd-a277ac660bdf2871ebbcddcb5288e29a03a46c92.tar.xz mpd-a277ac660bdf2871ebbcddcb5288e29a03a46c92.zip |
screen_browser: added browser_cmd()
Merge a lot of code from the 3 browser screen into browser_cmd().
Diffstat (limited to '')
-rw-r--r-- | src/screen_search.c | 48 |
1 files changed, 1 insertions, 47 deletions
diff --git a/src/screen_search.c b/src/screen_search.c index 981c0a58b..b7020c043 100644 --- a/src/screen_search.c +++ b/src/screen_search.c @@ -432,32 +432,6 @@ static int search_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) { switch (cmd) { - case CMD_PLAY: - browser_handle_enter(&browser, c); - search_repaint(); - return 1; - - case CMD_SELECT: - if (browser_handle_select(&browser, c) == 0) { - /* continue and select next item... */ - cmd = CMD_LIST_NEXT; - } - /* call list_window_cmd to go to the next item */ - break; - - case CMD_ADD: - if (browser_handle_add(&browser, c) == 0) - /* continue and select next item... */ - cmd = CMD_LIST_NEXT; - - /* call list_window_cmd to go to the next item */ - break; - - case CMD_SELECT_ALL: - browser_handle_select_all(&browser, c); - search_repaint(); - return 0; - case CMD_SEARCH_MODE: options.search_mode++; if (mode[options.search_mode].label == NULL) @@ -488,32 +462,12 @@ search_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) search_repaint(); return 1; - case CMD_LIST_FIND: - case CMD_LIST_RFIND: - case CMD_LIST_FIND_NEXT: - case CMD_LIST_RFIND_NEXT: - if (browser.filelist) { - screen_find(screen, - browser.lw, filelist_length(browser.filelist), - cmd, browser_lw_callback, - browser.filelist); - search_repaint(); - } - - return 1; - - case CMD_MOUSE_EVENT: - browser_handle_mouse_event(&browser, c); - search_repaint(); - return 1; - default: break; } if (browser.filelist != NULL && - list_window_cmd(browser.lw, - filelist_length(browser.filelist), cmd)) { + browser_cmd(&browser, screen, c, cmd)) { search_repaint(); return 1; } |