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_file.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 'src/screen_file.c')
-rw-r--r-- | src/screen_file.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/src/screen_file.c b/src/screen_file.c index 3870cbdc7..d12f77ef5 100644 --- a/src/screen_file.c +++ b/src/screen_file.c @@ -205,10 +205,6 @@ static int browse_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) { switch(cmd) { - case CMD_PLAY: - browser_handle_enter(&browser, c); - file_repaint(); - return 1; case CMD_GO_ROOT_DIRECTORY: browser_change_directory(&browser, c, NULL, ""); file_repaint(); @@ -217,18 +213,6 @@ browse_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) browser_change_directory(&browser, c, NULL, ".."); file_repaint(); return 1; - case CMD_SELECT: - if (browser_handle_select(&browser, c) == 0) { - /* continue and select next item... */ - cmd = CMD_LIST_NEXT; - } - break; - - case CMD_ADD: - if (browser_handle_add(&browser, c) == 0) - /* continue and select next item... */ - cmd = CMD_LIST_NEXT; - break; case CMD_DELETE: handle_delete(screen, c); @@ -266,29 +250,12 @@ browse_cmd(screen_t *screen, mpdclient_t *c, command_t cmd) } else screen_status_printf(_("Database update running...")); return 1; - case CMD_LIST_FIND: - case CMD_LIST_RFIND: - case CMD_LIST_FIND_NEXT: - case CMD_LIST_RFIND_NEXT: - screen_find(screen, - browser.lw, filelist_length(browser.filelist), - cmd, browser_lw_callback, - browser.filelist); - file_repaint(); - return 1; - - case CMD_MOUSE_EVENT: - if (browser_handle_mouse_event(&browser, c)) - file_repaint(); - - return 1; default: break; } - if (list_window_cmd(browser.lw, filelist_length(browser.filelist), - cmd)) { + if (browser_cmd(&browser, screen, c, cmd)) { file_repaint(); return 1; } |