aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen_keydef.c
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-06-30 17:18:02 +0000
committerKalle Wallin <kaw@linux.se>2004-06-30 17:18:02 +0000
commit919b0f13474fd323c7cd9e0b872b1990068a012d (patch)
treebb24d5e31ec390c8df695704881e0d0a96aa0adc /src/screen_keydef.c
parente6c52179ca6e78a0a6a61002a80aa37b4f21719c (diff)
downloadmpd-919b0f13474fd323c7cd9e0b872b1990068a012d.tar.gz
mpd-919b0f13474fd323c7cd9e0b872b1990068a012d.tar.xz
mpd-919b0f13474fd323c7cd9e0b872b1990068a012d.zip
Added flags for conflicting, modified key bindings - check_key_bindings()
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1743 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/screen_keydef.c')
-rw-r--r--src/screen_keydef.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/screen_keydef.c b/src/screen_keydef.c
index b85c094c5..7ea8c3fdb 100644
--- a/src/screen_keydef.c
+++ b/src/screen_keydef.c
@@ -137,10 +137,12 @@ delete_key(int cmd_index, int key_index)
while( i<MAX_COMMAND_KEYS && cmds[cmd_index].keys[i] )
cmds[cmd_index].keys[key_index++] = cmds[cmd_index].keys[i++];
cmds[cmd_index].keys[key_index] = 0;
-
+ cmds[cmd_index].flags |= COMMAND_KEY_MODIFIED;
check_subcmd_length();
lw->clear = 1;
lw->repaint = 1;
+ /* update key conflict flags */
+ check_key_bindings(cmds, NULL, 0);
}
static void
@@ -169,10 +171,14 @@ assign_new_key(WINDOW *w, int cmd_index, int key_index)
return;
}
cmds[cmd_index].keys[key_index] = key;
+ cmds[cmd_index].flags |= COMMAND_KEY_MODIFIED;
+
screen_status_printf(_("Assigned %s to %s"),
key2str(key),cmds[cmd_index].name);
check_subcmd_length();
lw->repaint = 1;
+ /* update key conflict flags */
+ check_key_bindings(cmds, NULL, 0);
}
static char *
@@ -180,10 +186,15 @@ list_callback(int index, int *highlight, void *data)
{
static char buf[BUFSIZE];
+ *highlight = 0;
if( subcmd <0 )
{
if( index<command_list_length )
- return cmds[index].name;
+ {
+ if( cmds[index].flags & COMMAND_KEY_CONFLICT )
+ *highlight = 1;
+ return cmds[index].name;
+ }
else if( index==LIST_ITEM_APPLY() )
return LIST_ITEM_APPLY_LABEL;
else if( index==LIST_ITEM_SAVE() )
@@ -347,6 +358,10 @@ keydef_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
delete_key(subcmd, lw->selected-STATIC_SUB_ITEMS);
return 1;
break;
+ case CMD_SAVE_PLAYLIST:
+ apply_keys();
+ save_keys();
+ break;
case CMD_LIST_FIND:
case CMD_LIST_RFIND:
case CMD_LIST_FIND_NEXT: