Mercurial > pidgin.yaz
changeset 17717:f189497429c5
The rebinding of keys now removes the old binding and puts the new on in place. So only the new binding works and the old one is gone.
author | Eric Polino <aluink@pidgin.im> |
---|---|
date | Wed, 06 Jun 2007 00:30:20 +0000 |
parents | 57c508361cff |
children | 8410511f4dbb |
files | finch/libgnt/gntwm.c |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/finch/libgnt/gntwm.c Wed Jun 06 00:06:48 2007 +0000 +++ b/finch/libgnt/gntwm.c Wed Jun 06 00:30:20 2007 +0000 @@ -63,12 +63,13 @@ static struct { - char * keys; /* Keystrokes being bound to the action */ + char * okeys; /* Old keystrokes */ + char * keys; /* New Keystrokes being bound to the action */ GntBindableClass * klass; /* Class of the object that's getting keys rebound */ char * name; /* The name of the action */ GList * params; /* The list of paramaters */ -} rebind_info = {NULL,NULL,NULL,NULL}; +} rebind_info = {NULL,NULL,NULL,NULL,NULL}; static GList * g_list_bring_to_front(GList *list, gpointer data) @@ -501,6 +502,7 @@ { g_free(rebind_info.name); g_free(rebind_info.keys); + g_free(rebind_info.okeys); } static gboolean @@ -515,6 +517,11 @@ help_for_widget_bind_button_activate(GntBindable *bindable, gpointer data) { + + gnt_bindable_register_binding(rebind_info.klass, + NULL, + rebind_info.okeys, + rebind_info.params); gnt_bindable_register_binding(rebind_info.klass, rebind_info.name, rebind_info.keys, @@ -580,7 +587,7 @@ rebind_info.name = g_strdup(g_list_nth_data(current_row_data,1)); keys = gnt_tree_get_selection_data(tree); - rebind_info.keys = g_strdup(gnt_key_translate(keys)); + rebind_info.okeys = g_strdup(gnt_key_translate(keys)); rebind_info.params = NULL;