From a72010a82e96606369d00c98973ee4b4b43ac243 Mon Sep 17 00:00:00 2001 From: Thomas Hurst Date: Wed, 21 Jan 2009 09:06:16 +0000 Subject: [PATCH] Teach the profile editor about undefined keys. --- terminatorlib/prefs_profile.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/terminatorlib/prefs_profile.py b/terminatorlib/prefs_profile.py index ff56e8ff..67dc2507 100644 --- a/terminatorlib/prefs_profile.py +++ b/terminatorlib/prefs_profile.py @@ -324,7 +324,11 @@ class ProfileEditor: value = self.term.conf.keybindings[row[0]] if isinstance (value, tuple): value = value[0] - if (row[2], row[3]) != self.tkbobj._parsebinding(value): + keyval = 0 + mask = 0 + if value is not None: + (keyval, mask) = self.tkbobj._parsebinding(value) + if (row[2], row[3]) != (keyval, mask): changed_keybindings.append ((row[0], accel)) dbg("%s changed from %s to %s" % (row[0], self.term.conf.keybindings[row[0]], accel)) @@ -350,12 +354,12 @@ class ProfileEditor: for binding in Defaults['keybindings']: value = self.term.conf.keybindings[binding] - if (value.__class__.__name__ != 'str'): - if isinstance (value, tuple): - value = value[0] - else: - continue - (keyval, mask) = self.tkbobj._parsebinding (value) + keyval = 0 + mask = 0 + if isinstance (value, tuple): + value = value[0] + if value is not None: + (keyval, mask) = self.tkbobj._parsebinding (value) self.liststore.append ([binding, self.source_get_keyname (binding), keyval, mask, True]) dbg("Appended row: %s, %s, %s" % (binding, keyval, mask))