Make keybinding errors significantly less fatal. Closes LP #476271
This commit is contained in:
parent
27ba562f56
commit
8ea4872af1
|
@ -79,8 +79,7 @@ class TerminatorKeybindings:
|
||||||
# Does much the same, but with poorer error handling.
|
# Does much the same, but with poorer error handling.
|
||||||
#keyval, mask = gtk.accelerator_parse(binding)
|
#keyval, mask = gtk.accelerator_parse(binding)
|
||||||
except KeymapError, ex:
|
except KeymapError, ex:
|
||||||
ex.action = action
|
continue
|
||||||
raise ex
|
|
||||||
else:
|
else:
|
||||||
if mask & gtk.gdk.SHIFT_MASK:
|
if mask & gtk.gdk.SHIFT_MASK:
|
||||||
if keyval == gtk.keysyms.Tab:
|
if keyval == gtk.keysyms.Tab:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
|
||||||
from terminatorlib.config import dbg,err,DEFAULTS,TerminatorConfValuestoreRC
|
from terminatorlib.config import dbg,err,DEFAULTS,TerminatorConfValuestoreRC
|
||||||
from terminatorlib.keybindings import TerminatorKeybindings
|
from terminatorlib.keybindings import TerminatorKeybindings, KeymapError
|
||||||
from terminatorlib.version import APP_NAME, APP_VERSION
|
from terminatorlib.version import APP_NAME, APP_VERSION
|
||||||
from terminatorlib import translation
|
from terminatorlib import translation
|
||||||
|
|
||||||
|
@ -363,7 +363,10 @@ class ProfileEditor:
|
||||||
keyval = 0
|
keyval = 0
|
||||||
mask = 0
|
mask = 0
|
||||||
if value is not None and value != "None":
|
if value is not None and value != "None":
|
||||||
|
try:
|
||||||
(keyval, mask) = self.tkbobj._parsebinding(value)
|
(keyval, mask) = self.tkbobj._parsebinding(value)
|
||||||
|
except KeymapError:
|
||||||
|
pass
|
||||||
if (row[2], row[3]) != (keyval, mask):
|
if (row[2], row[3]) != (keyval, mask):
|
||||||
changed_keybindings.append ((row[0], accel))
|
changed_keybindings.append ((row[0], accel))
|
||||||
dbg("%s changed from %s to %s" % (row[0], self.term.conf.keybindings[row[0]], accel))
|
dbg("%s changed from %s to %s" % (row[0], self.term.conf.keybindings[row[0]], accel))
|
||||||
|
@ -392,7 +395,10 @@ class ProfileEditor:
|
||||||
if isinstance (value, tuple):
|
if isinstance (value, tuple):
|
||||||
value = value[0]
|
value = value[0]
|
||||||
if value is not None and value != "None":
|
if value is not None and value != "None":
|
||||||
|
try:
|
||||||
(keyval, mask) = self.tkbobj._parsebinding (value)
|
(keyval, mask) = self.tkbobj._parsebinding (value)
|
||||||
|
except KeymapError:
|
||||||
|
pass
|
||||||
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))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue