Allow a keybinding to be set to a string value of None so it can be deconfigured. Also supports clearing a keybinding through the prefs profile. Closes LP #391778
This commit is contained in:
parent
34c9c816ea
commit
dcd997b3de
|
@ -71,7 +71,7 @@ class TerminatorKeybindings:
|
||||||
bindings = (bindings,)
|
bindings = (bindings,)
|
||||||
|
|
||||||
for binding in bindings:
|
for binding in bindings:
|
||||||
if binding is None:
|
if binding is None or binding == "None":
|
||||||
continue
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -391,7 +391,7 @@ class ProfileEditor:
|
||||||
mask = 0
|
mask = 0
|
||||||
if isinstance (value, tuple):
|
if isinstance (value, tuple):
|
||||||
value = value[0]
|
value = value[0]
|
||||||
if value is not None:
|
if value is not None and value != "None":
|
||||||
(keyval, mask) = self.tkbobj._parsebinding (value)
|
(keyval, mask) = self.tkbobj._parsebinding (value)
|
||||||
self.liststore.append ([binding, self.source_get_keyname (binding), keyval, mask, True])
|
self.liststore.append ([binding, self.source_get_keyname (binding), keyval, mask, True])
|
||||||
dbg("Appended row: %s, %s, %s" % (binding, keyval, mask))
|
dbg("Appended row: %s, %s, %s" % (binding, keyval, mask))
|
||||||
|
@ -418,6 +418,7 @@ class ProfileEditor:
|
||||||
col.set_attributes(cell, accel_key=2, accel_mods=3, editable=4)
|
col.set_attributes(cell, accel_key=2, accel_mods=3, editable=4)
|
||||||
|
|
||||||
cell.connect ('accel-edited', self.edited)
|
cell.connect ('accel-edited', self.edited)
|
||||||
|
cell.connect ('accel-cleared', self.cleared)
|
||||||
|
|
||||||
self.treeview.append_column(col)
|
self.treeview.append_column(col)
|
||||||
|
|
||||||
|
@ -429,3 +430,7 @@ class ProfileEditor:
|
||||||
def edited (self, obj, path, key, mods, code):
|
def edited (self, obj, path, key, mods, code):
|
||||||
iter = self.liststore.get_iter_from_string(path)
|
iter = self.liststore.get_iter_from_string(path)
|
||||||
self.liststore.set(iter, 2, key, 3, mods)
|
self.liststore.set(iter, 2, key, 3, mods)
|
||||||
|
|
||||||
|
def cleared (self, obj, path):
|
||||||
|
iter = self.liststore.get_iter_from_string(path)
|
||||||
|
self.liststore.set(iter, 2, 0, 3, 0)
|
||||||
|
|
Loading…
Reference in New Issue