readding thomas changes

This commit is contained in:
Emmanuel Bretelle 2008-08-25 20:56:08 +01:00
commit 47bc7bc378
3 changed files with 53 additions and 35 deletions

View File

@ -105,8 +105,8 @@ Defaults = {
'zoom_normal' : '<Ctrl>0', 'zoom_normal' : '<Ctrl>0',
'new_root_tab' : '<Ctrl><Shift><Alt>T', 'new_root_tab' : '<Ctrl><Shift><Alt>T',
'new_tab' : '<Ctrl><Shift>T', 'new_tab' : '<Ctrl><Shift>T',
'go_next' : '<Ctrl><Shift>N', 'go_next' : ('<Ctrl><Shift>N','<Ctrl>Tab'),
'go_prev' : '<Ctrl><Shift>P', 'go_prev' : ('<Ctrl><Shift>P','<Ctrl><Shift>Tab'),
'split_horiz' : '<Ctrl><Shift>O', 'split_horiz' : '<Ctrl><Shift>O',
'split_vert' : '<Ctrl><Shift>E', 'split_vert' : '<Ctrl><Shift>E',
'close_term' : '<Ctrl><Shift>W', 'close_term' : '<Ctrl><Shift>W',

View File

@ -32,11 +32,15 @@ class TerminatorKeybindings:
def reload(self): def reload(self):
self._lookup = {} self._lookup = {}
self._masks = 0 self._masks = 0
for action, binding in self.keys.items(): for action, bindings in self.keys.items():
if not isinstance(bindings, tuple):
bindings = (bindings,)
for binding in bindings:
try: try:
keyval, mask = self._parsebinding(binding) keyval, mask = self._parsebinding(binding)
# Does much the same, but with poorer error handling.
#keyval, mask = gtk.accelerator_parse(binding) #keyval, mask = gtk.accelerator_parse(binding)
#mask = int(mask)
except KeymapError, e: except KeymapError, e:
e.action = action e.action = action
raise e raise e

View File

@ -29,6 +29,20 @@ class ProfileEditor:
value = Defaults[key] value = Defaults[key]
widget = None widget = None
if key == 'font':
#widget = gtk.FontSelection()
#widget.set_preview_text("Terminator: The robot future of terminals")
#widget.set_font_name(value)
widget = gtk.FontButton(value)
elif key == 'scrollback_lines':
# estimated byte size per line according to g-t:
# sizeof(void *) + sizeof(char *) + sizeof(int) + (80 * (sizeof(int32) + 4)
widget = gtk.SpinButton()
widget.set_digits(0)
widget.set_increments(100, 1000)
widget.set_range(0, 100000)
widget.set_value(value)
else:
if type == "bool": if type == "bool":
widget = gtk.CheckButton () widget = gtk.CheckButton ()
widget.set_active (value) widget.set_active (value)