Code

screen_help: added the artist screen hotkey
[ncmpc.git] / src / screen_help.c
index 1f0043c094b719ba06deeb91ff95d52bf6770a0f..8804c950bd22735da8b7be9a28af74797c3cb085 100644 (file)
@@ -22,7 +22,6 @@
 #include "command.h"
 #include "screen.h"
 #include "screen_utils.h"
-#include "gcc.h"
 
 #include <stdlib.h>
 #include <string.h>
@@ -49,6 +48,9 @@ static help_text_row_t help_text[] = {
        { 0, CMD_SCREEN_HELP, NULL },
        { 0, CMD_SCREEN_PLAY, NULL },
        { 0, CMD_SCREEN_FILE, NULL },
+#ifdef ENABLE_ARTIST_SCREEN
+       { 0, CMD_SCREEN_ARTIST, NULL },
+#endif
 #ifdef ENABLE_SEARCH_SCREEN
        { 0, CMD_SCREEN_SEARCH, NULL },
 #endif
@@ -81,6 +83,8 @@ static help_text_row_t help_text[] = {
        { 0, CMD_LIST_FIND_NEXT, NULL },
        { 0, CMD_LIST_RFIND_NEXT, NULL },
        { 0, CMD_TOGGLE_FIND_WRAP, NULL },
+       { 0, CMD_LOCATE, NULL },
+       { 0, CMD_VIEW, NULL },
        { 0, CMD_NONE, NULL },
        { 0, CMD_QUIT, NULL },
 
@@ -141,7 +145,7 @@ static help_text_row_t help_text[] = {
 static list_window_t *lw;
 
 static const char *
-list_callback(unsigned idx, int *highlight, mpd_unused void *data)
+list_callback(unsigned idx, bool *highlight, G_GNUC_UNUSED void *data)
 {
        static char buf[512];
 
@@ -149,7 +153,7 @@ list_callback(unsigned idx, int *highlight, mpd_unused void *data)
                return NULL;
 
        if (help_text[idx].highlight)
-               *highlight = 1;
+               *highlight = true;
 
        if (help_text[idx].command == CMD_NONE) {
                if (help_text[idx].text)
@@ -182,7 +186,7 @@ static void
 help_init(WINDOW *w, int cols, int rows)
 {
   lw = list_window_init(w, cols, rows);
-  lw->flags = LW_HIDE_CURSOR;
+       lw->hide_cursor = true;
 }
 
 static void
@@ -200,7 +204,7 @@ help_exit(void)
 
 
 static const char *
-help_title(mpd_unused char *str, mpd_unused size_t size)
+help_title(G_GNUC_UNUSED char *str, G_GNUC_UNUSED size_t size)
 {
        return _("Help");
 }
@@ -211,13 +215,13 @@ help_paint(void)
        list_window_paint(lw, list_callback, NULL);
 }
 
-static int
-help_cmd(mpd_unused mpdclient_t *c, command_t cmd)
+static bool
+help_cmd(G_GNUC_UNUSED mpdclient_t *c, command_t cmd)
 {
        if (list_window_scroll_cmd(lw, help_text_rows, cmd)) {
                list_window_paint(lw, list_callback, NULL);
                wrefresh(lw->w);
-               return 1;
+               return true;
        }
 
        lw->selected = lw->start+lw->rows;
@@ -227,10 +231,10 @@ help_cmd(mpd_unused mpdclient_t *c, command_t cmd)
                list_window_center(lw, help_text_rows, lw->selected);
                list_window_paint(lw, list_callback, NULL);
                wrefresh(lw->w);
-               return 1;
+               return true;
        }
 
-       return 0;
+       return false;
 }
 
 const struct screen_functions screen_help = {