summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 243a7a2)
raw | patch | inline | side by side (parent: 243a7a2)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Thu, 22 Dec 2011 21:13:04 +0000 (22:13 +0100) | ||
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Thu, 22 Dec 2011 21:42:04 +0000 (22:42 +0100) |
(And true/false in calls to it)
src/command.c | patch | blob | history | |
src/command.h | patch | blob | history | |
src/main.c | patch | blob | history | |
src/screen_search.c | patch | blob | history | |
src/title_bar.c | patch | blob | history |
diff --git a/src/command.c b/src/command.c
index 4f525605141784058873f04a00c9c29832a3c63a..656bb18e389db0bd89a1389be818a861d2a7a3e1 100644 (file)
--- a/src/command.c
+++ b/src/command.c
{
for (int i = 0; cmds[i].description; i++)
if (cmds[i].command != CMD_NONE)
- printf(" %20s : %s\n", get_key_names(cmds[i].command,1),cmds[i].name);
+ printf(" %20s : %s\n",
+ get_key_names(cmds[i].command, true),
+ cmds[i].name);
}
#ifndef NCMPC_MINI
#endif
const char *
-get_key_names(command_t command, int all)
+get_key_names(command_t command, bool all)
{
for (int i = 0; cmds[i].description; i++) {
if (cmds[i].command == command) {
diff --git a/src/command.h b/src/command.h
index 3a7d61d9d6322c2d13eea2bb84dc17eb959bf5c8..225d76e5fb4bfa5e4a7c00a9ea26eaf6a89d4083 100644 (file)
--- a/src/command.h
+++ b/src/command.h
#include "config.h"
#include <stddef.h>
+#include <stdbool.h>
#ifndef NCMPC_MINI
#include <stdio.h>
const char *key2str(int key);
const char *get_key_description(command_t command);
const char *get_key_command_name(command_t command);
-const char *get_key_names(command_t command, int all);
+const char *get_key_names(command_t command, bool all);
command_t get_key_command(int key);
command_t get_key_command_from_name(char *name);
int assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]);
diff --git a/src/main.c b/src/main.c
index 1581e78875658f50fd487015c2cc566fd248d435..ffc310fcee2b183d862c77e9c2bf83f8166929df 100644 (file)
--- a/src/main.c
+++ b/src/main.c
char *name = default_settings_name();
screen_status_printf(_("Connecting to %s... [Press %s to abort]"),
- name, get_key_names(CMD_QUIT,0) );
+ name, get_key_names(CMD_QUIT, false));
g_free(name);
doupdate();
and this is a hint for the user what to press to correct
that */
g_snprintf(comment, sizeof(comment), _("press %s for the key editor"),
- get_key_names(CMD_SCREEN_KEYDEF, 0));
+ get_key_names(CMD_SCREEN_KEYDEF, false));
g_strlcat(buf, comment, sizeof(buf));
g_strlcat(buf, ")", sizeof(buf));
#endif
diff --git a/src/screen_search.c b/src/screen_search.c
index 5e9226e6cff234246638f1121bf1c15447ae2860..81ca8e4840c3fe7e9a71e753575146b152c78fad 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
// search_new(screen, c);
// else
screen_status_printf(_("Press %s for a new search"),
- get_key_names(CMD_SCREEN_SEARCH,0));
+ get_key_names(CMD_SCREEN_SEARCH, false));
search_check_mode();
}
_(mode[options.search_mode].label));
else
g_snprintf(str, size, _("Search: Press %s for a new search [%s]"),
- get_key_names(CMD_SCREEN_SEARCH,0),
+ get_key_names(CMD_SCREEN_SEARCH, false),
_(mode[options.search_mode].label));
return str;
diff --git a/src/title_bar.c b/src/title_bar.c
index bbbd6de2c5f6ce340bdc6f767455182514ceb950..7fdce0c21dd9a0f63fa83106bf8d27a65943ffd4 100644 (file)
--- a/src/title_bar.c
+++ b/src/title_bar.c
print_hotkey(WINDOW *w, command_t cmd, const char *label)
{
colors_use(w, COLOR_TITLE_BOLD);
- waddstr(w, get_key_names(cmd, FALSE));
+ waddstr(w, get_key_names(cmd, false));
colors_use(w, COLOR_TITLE);
waddch(w, ':');
waddstr(w, label);