summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 262019b)
raw | patch | inline | side by side (parent: 262019b)
author | Max Kellermann <max@duempel.org> | |
Thu, 1 Oct 2009 22:01:43 +0000 (00:01 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 1 Oct 2009 22:01:43 +0000 (00:01 +0200) |
src/screen_browser.c | patch | blob | history |
diff --git a/src/screen_browser.c b/src/screen_browser.c
index 5b41c33631be260dc4a05c6dac8292c2e2ca1623..638803df58433a0bb41d167155e33c9e59d8f859 100644 (file)
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
if (browser->filelist == NULL)
return false;
- switch (cmd) {
- case CMD_PLAY:
- browser_handle_enter(browser, c);
- return true;
-
- case CMD_SELECT:
- if (browser_handle_select(browser, c))
- /* 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))
- /* 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);
+ if (list_window_cmd(browser->lw, filelist_length(browser->filelist),
+ cmd))
return true;
+ switch (cmd) {
case CMD_LIST_FIND:
case CMD_LIST_RFIND:
case CMD_LIST_FIND_NEXT:
return true;
#endif
- case CMD_LOCATE:
- song = browser_get_selected_song(browser);
- if (song == NULL)
- return false;
-
- screen_file_goto_song(c, song);
- return true;
-
#ifdef ENABLE_LYRICS_SCREEN
case CMD_SCREEN_LYRICS:
song = browser_get_selected_song(browser);
break;
}
- if (list_window_cmd(browser->lw, filelist_length(browser->filelist),
- cmd))
+ if (!mpdclient_is_connected(c))
+ return false;
+
+ switch (cmd) {
+ case CMD_PLAY:
+ browser_handle_enter(browser, c);
+ return true;
+
+ case CMD_SELECT:
+ if (browser_handle_select(browser, c))
+ /* 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))
+ /* 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);
+ return true;
+
+ case CMD_LOCATE:
+ song = browser_get_selected_song(browser);
+ if (song == NULL)
+ return false;
+
+ screen_file_goto_song(c, song);
return true;
+ default:
+ break;
+ }
+
return false;
}